467,921 Members | 1,336 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,921 developers. It's quick & easy.

sslstream and certificates

This is a question about partly .net sslStreams and partly about the
certificates it uses.
I can't seem to find a more specific group.. and since i am coding in c# :-)

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:\mycertific ate.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?

What I am working on is a http server for a program that needs to provide a
web interface. I would very much like to have it running though SSL. Note
that this is ofcourse not an asp application but regular winforms.
Nov 17 '05 #1
  • viewed: 1728
Share:

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by asnowfall | last post: by
1 post views Thread by Chris Mullins | last post: by
reply views Thread by John | last post: by
1 post views Thread by Dubravko Sever | last post: by
3 posts views Thread by =?Utf-8?B?VHJlY2l1cw==?= | last post: by
reply views Thread by Steven Blair | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.