License:
BSD style: see license.txtAuthor:
Jeff Davey
1 2 3 4 5 6 7 8 9 10 11 12 | auto cert = new Certificate(cast(char[])File("public.pem").read); auto pkey = new PrivateKey(cast(char[])File("private.pem").read); auto ctx = new SSLCtx(); ctx.certificate(cert).privateKey(pkey); auto server = new SSLServerSocket(new InternetAddress(443), ctx); for(;;) { auto sslSock = server.accept(); sc.write("HTTP/1.1 200\r\n\r\n<b>Hello World</b>"); sc.shutdown(); sc.close(); } |
Params:
| addr | the address to bind and listen on. |
| ctx | the provided SSLCtx |
| backlog | the number of connections to backlog before refusing connection |
| reuse | if enabled, allow rebinding of existing ip/port |