haskellsslhttpslets-encrypthaskell-snap-framework

HTTPS with Snap in production


I have the following configuration for my Snap

  Local.withPool 2 $ \pool -> do
Local.parallel_ pool [ httpServe (setPort (read port) config) Main.skite
                     --, httpServe (setPort 8003 config) Ws.brz
                     ]

--httpServe (setPort 8003 config) Ws.brz
where
 config =
     setErrorLog  ConfigNoLog $
     setAccessLog ConfigNoLog $
     setSSLPort 443 $
     setSSLCert "/etc/letsencrypt/../cert.pem" $
     setSSLKey "/etc/letsencrypt/../privkey.pem" $
     defaultConfig

After i am building and uploading, all the certs are in the place, yet the https:// won't work. Do you have any clues?

Thanks


Solution

  • I did it:

    First of all i added this two lines to the config

         setSSLBind "0.0.0.0" $
         setSSLChainCert False $
    

    After this, is very important to build with ghc -threaded and this will get it up and running