Re: sslstream and certificates

From: Dominick Baier [DevelopMentor] (dbaier_at_pleasepleasenospamdevelop.com)
Date: 05/26/05


Date: Thu, 26 May 2005 09:55:46 -0700

Hello Jakob,

i described the procedure

here: http://www.leastprivilege.com/PermaLink.aspx?guid=f34680fd-a58d-43a7-ba6d-2d813814ee73
and here: http://www.leastprivilege.com/PermaLink.aspx?guid=6b5d5471-0710-41d7-891b-308afa959a6e

---------------------------------------
Dominick Baier - DevelopMentor
http://www.leastprivilege.com

> Using net 2.0
>
> I try creating a sslStream from a regular networkstream as folows
>
> Socket clientSocket = serverSocket.EndAccept(result);
> clientSocket.Blocking = true;
> Stream clientStream = new NetworkStream(clientSocket);
> SslStream sslStream = new SslStream(clientStream);
> X509Certificate cert =
> X509Certificate.CreateFromCertFile(@"c:\mycertificate.crt");
> sslStream.AuthenticateAsServer(cert);
> The call to AuthenticateAsServer fails with "The server mode SSL must
> use a certificate with the associated private key"
>
> What exactly should I put into that message? It needs another kind of
> certificate with the private key embedded?
> I do have a keyfile on the side with one of my certificates, but I can
> not
> specify it anywhere.
> Another certificate , I am testing with, is from rapidSSL a CA so I
> assume
> it should be "right".
> Has someone else tried setting up a sslStream as server?
>
> Should i somehow put my private key into my certificate? I read
> somewhere that you could concatenate the two files, but that didnt
> resolve the problem.
>



Relevant Pages

  • sslstream and certificates
    ... I try creating a sslStream from a regular networkstream as folows ... certificate with the associated private key" ... Has someone else tried setting up a sslStream as server? ...
    (microsoft.public.dotnet.languages.csharp)
  • sslstream and certificates
    ... I try creating a sslStream from a regular networkstream as folows ... Socket clientSocket = serverSocket.EndAccept; ... certificate with the associated private key" ...
    (microsoft.public.dotnet.security)
  • Re: Can SslStream be set to ignore invalid certificates?
    ... the certificate validation callback allows you to do your own checking. ... is much more SSL functionality in .NET 2.0, such as the SslStream, I ... If authentication succeeds, everything in the ... In IE, for instance, if you run across an "invalid" certificate, you ...
    (microsoft.public.dotnet.security)
  • RE: SIMple SSL question ??
    ... I believe your book is instructing you to keep the private key secure. ... you use the certificate request wizard in IIS to install the cert after it's ... the certificate that's just been installed. ... If an attacker retrievs the SSL certificate, ...
    (microsoft.public.dotnet.security)
  • RE: SIMple SSL question ??
    ... I believe your book is instructing you to keep the private key secure. ... you use the certificate request wizard in IIS to install the cert after it's ... the certificate that's just been installed. ... If an attacker retrievs the SSL certificate, ...
    (microsoft.public.dotnet.security)