SSLServerSocket is a sub-class of ServerSocket. It's purpose is to provide SSL encryption at the socket level as well as easily tie into existing Tango applications that may already be using ServerSocket.
SSLServerSocket requires the OpenSSL library, and uses a dynamic binding to the library. You can find the library at http://www.openssl.org and a Win32 specific port at http://www.slproweb.com/products/Win32OpenSSL.html.
Example SSL server
auto cert = new Certificate(cast(char[])File.get("public.pem")); auto pkey = new PrivateKey(cast(char[])File.get("private.pem")); auto ctx = new SSLCtx; ctx.certificate(cert).privateKey(pkey); auto server = new SSLServerSocket(443, ctx); for(;;) { auto sc = server.accept; sc.write("HTTP/1.1 200\r\n\r\n<b>Hello World</b>"); sc.shutdown.close; }
Constructs a new SSLServerSocket. This constructor is similar to ServerSocket, except it takes a SSLCtx as provided by PKI.
Accepts a new connection and copies the provided server SSLCtx to a new SSLSocket.
Return the name of this device
See Implementation
SSLServerSocket is a sub-class of ServerSocket. It's purpose is to provide SSL encryption at the socket level as well as easily tie into existing Tango applications that may already be using ServerSocket.
SSLServerSocket requires the OpenSSL library, and uses a dynamic binding to the library. You can find the library at http://www.openssl.org and a Win32 specific port at http://www.slproweb.com/products/Win32OpenSSL.html.
Example SSL server