Reputation: 85462
How to disable SSL certificate validation when using the Haskell req
library? Similar to curl -k
.
Upvotes: 1
Views: 382
Reputation: 85462
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 -- ...
Upvotes: 3