1

How to disable SSL certificate validation when using the Haskell req library? Similar to curl -k.

duplode
  • 33,731
  • 7
  • 79
  • 150
Sridhar Ratnakumar
  • 81,433
  • 63
  • 146
  • 187

1 Answers1

3
import Network.Connection (TLSSettings (TLSSettingsSimple))
import Network.HTTP.Client (newManager)
import Network.HTTP.Client.TLS (mkManagerSettings)
import Network.HTTP.Req

main = do
  myManager <- newManager $ mkManagerSettings (TLSSettingsSimple True False False) Nothing
  let httpConfig = def { httpConfigAltManager = Just myManager }
  runReq httpConfig $ do
    req POST -- ...
Sridhar Ratnakumar
  • 81,433
  • 63
  • 146
  • 187