by J.R. Brown [jrbrown3 at hotmail dot com] posted on 2005/02/07 |
|
The code snippet below works great if I don't specify 'options' when creating the new SecureSocket.
If the code looks familar, its from the Cassini source located on ASP.NET's website. I've heard from many people that are interested in adding SSL capability to this app.
From all indications, It appears that the certificate is being created successfully.
Could this be a bug in the Security Library? Any ideas are welcome. If I find a fix, I'll post it back. If you prefer to e-mail me, that's fine too.
Kind Regards - J.R.
--------------------CODE-----------------
if (_started)
throw new InvalidOperationException();
CertificateStore cs = CertificateStore.CreateFromPfxFile("C:\\server.pfx", "test");
Certificate cert = cs.FindCertificateByUsage( new string[] {"1.3.6.1.5.5.7.3.1"});
String debug_test = cert.PublicKey.ToString();
SecurityOptions options = new SecurityOptions(SecureProtocol.Ssl3, cert, ConnectionEnd.Server);
_socket = new SecureSocket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp, options);
_socket.Bind(new IPEndPoint(IPAddress.Any, _port));
_socket.Listen((int)SocketOptionName.MaxConnections);
_started = true;
ThreadPool.QueueUserWorkItem(_onStart);
} |
by Dmytro [dmytro at iroot dot ca] posted on 2005/04/06 |
|
I wrote a full y working HTTPS web server from this socket, and it supports FUll ASP.NET just like Cassini. I did not find any problems except that when I try to get remote client IP if connection is dropped before i can get it I get strage concole error, but i can live with that. |