Nowin icon indicating copy to clipboard operation
Nowin copied to clipboard

Support for SSL using owin hosting

Open igorgatis opened this issue 10 years ago • 7 comments

According to sample code, it seems that SSL support requires Nowin server to be instantiated directly, lacking the support for Microsoft.Owin.Hosting.

igorgatis avatar Sep 24 '14 12:09 igorgatis

In that time I written it, there was no support for it in Microsoft.Owin.Hosting - there was no way to pass Certificate? Is it now possible?

Bobris avatar Sep 24 '14 21:09 Bobris

From discussion thread on OWIN, there's a willingness to go ahead with this, but no standard update. Maybe you could create a custom/extension property in StartupOptions.Settings to avoid the Builder's boilerplate? Something like

Settings["server.certificateBindings.PORT#"]  = PATHNAME_TO_X509_PFX

It's not ideal by any means, but it would give most people most of what they want. For advanced scenarios we could still use Builder.

et1975 avatar Mar 23 '15 13:03 et1975

If PFX, I would also need password, so 2 properties. Or I need instance of X509Certificate. Don't you want to try to write it on your own it is probably much easier to write directly code you need: https://github.com/Bobris/Nowin/blob/master/Nowin/OwinServerFactory.cs#L73

Bobris avatar Mar 23 '15 14:03 Bobris

Right, forgot about the password. The "certificate" property, I guess I'd set it in my Startup.Configuration() on an IAppBuilder instance?

et1975 avatar Mar 23 '15 15:03 et1975

I don't know if it is possible to set in Startup.Configuration, but it could be. At the time it was just simple proposal how it could work, it was never tested by me.

Bobris avatar Mar 23 '15 16:03 Bobris

What's the discussion thread on OWIN? I've not seen anything?

serialseb avatar Mar 23 '15 17:03 serialseb

https://groups.google.com/forum/#!searchin/net-http-abstractions/SSL/net-http-abstractions/-icGvmayRAY/8ku-YSlH2C8J 2 year old, that's ancient in internet-years :)

et1975 avatar Mar 23 '15 17:03 et1975