http4s / http4s_demo

See how easy http4s makes life
Other
14 stars 7 forks source link

How to setup SSL authentication to resources? #7

Closed wpoosanguansit closed 9 years ago

wpoosanguansit commented 9 years ago

It would be useful to have sample of ssl enabled authentication to http services as well. I have looked at Blaze http sample code but I am not quite sure if it would be the same a layer up. Thanks for your help.

bryce-anderson commented 9 years ago

This is probably outside of the scope of the demo: its unlikely I'm going to get a signed SSL certificate for it.

Check out the ServerBuilder, in particular the SSLSupport trait. I believe the blaze, jetty, and possibly other backends support it. Assuming you've made you certificates right, all you need to do is set the right flags in the withSSL method.