Re: sslstream and certificates
From: Joe Kaplan \(MVP - ADSI\) (joseph.e.kaplan_at_removethis.accenture.com)
Date: 05/26/05
- Next message: Sathyaish: "HKEY_USERS, what is it for?"
- Previous message: Joe Kaplan \(MVP - ADSI\): "Re: Impersonation through HttpModule"
- In reply to: Jakob Nielsen: "sslstream and certificates"
- Next in thread: Jakob Nielsen: "Re: sslstream and certificates"
- Reply: Jakob Nielsen: "Re: sslstream and certificates"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Thu, 26 May 2005 09:46:28 -0500
You need to install the private key into the CAPI keystore. If you have a
p12 or pfx file with the certificate and private key, you can use that to
import them into the key store.
Windows doesn't let you read private keys directly off the file system like
that. It wants to use the CAPI store. When you specify a certificate to
use, it simply uses that as a key to look up that certificate in the CAPI
store and find the associated private key.
HTH,
Joe K.
"Jakob Nielsen" <a@b.c> wrote in message
news:u%231x$5fYFHA.3032@TK2MSFTNGP10.phx.gbl...
> 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.
>
>
- Next message: Sathyaish: "HKEY_USERS, what is it for?"
- Previous message: Joe Kaplan \(MVP - ADSI\): "Re: Impersonation through HttpModule"
- In reply to: Jakob Nielsen: "sslstream and certificates"
- Next in thread: Jakob Nielsen: "Re: sslstream and certificates"
- Reply: Jakob Nielsen: "Re: sslstream and certificates"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|