Spock or Wai/Warp and HTTPS

353 Views Asked by At

I have a Spock web site which must be available via HTTPS. How can I setup it up properly for that? I think it should be the same way as for Wai/Warp, but still there's no information which is up to date.

2

There are 2 best solutions below

1
On

Use the runTLS fn from warp-tls here.

2
On

I haven't used Spock, but how about this?

spockCfg <- defaultSpockCfg () PCNoDatabase ()
app <- spockAsApp (spock spockCfg yourAppMonad)
runTLS defaultTlsSettings (tlsSettings "cert.pem" "privkey.pem") app