HTTPS support.
PhonicUK opened this issue · comments
It'd be very nice to see HTTPS support like the old standalone webserver component had. Especially if it can be implemented using TLS. I'd be quite happy to throw some money at whoever can make this happen.
+1
Here is how you do it in the Griffin.Framework branch:
var listener = new HttpListener();
listener.ChannelFactory = new SecureTcpChannelFactory(new ServerSideSslStreamBuilder(certificate));
listener.ClientConnected += OnConnect;
listener.MessageReceived = OnMessage;
listener.BodyDecoder = new CompositeIMessageSerializer();
listener.Start(IPAddress.Any, 8083);
Does this support client certificates too?
Yes, use the ClientSideSslStreamBuilder instead.
Sorry, wrong of me. Just set the UseClientCertificate
to true in the ServerSideSslStreamBuilder
Great :)
What about performing authentication of the certificates provided by clients, is there an event handler to hook into? Or better yet, is there a sample that includes the use of client certificates?
Create MyServerSideSslStreamBuilder
and override OnRemoteCertifiateValidation
It works like described at MSDN: http://msdn.microsoft.com/en-us/library/system.net.security.remotecertificatevalidationcallback(v=vs.110).aspx
Is the Griffin.Framework branch the same Griffin.Framework I can now see on NuGet?
yes
It's the official branch now