From 4228447e91ec2de484821120b5840616afc24b31 Mon Sep 17 00:00:00 2001 From: Timo von Holtz Date: Fri, 23 Jan 2015 09:18:13 +1100 Subject: [PATCH] Add TLS support --- servant-client.cabal | 1 + src/Servant/Common/Req.hs | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/servant-client.cabal b/servant-client.cabal index db546f28..2b17dc21 100644 --- a/servant-client.cabal +++ b/servant-client.cabal @@ -44,6 +44,7 @@ library , either , exceptions , http-client + , http-client-tls , http-types , network-uri >= 2.6 , safe diff --git a/src/Servant/Common/Req.hs b/src/Servant/Common/Req.hs index d48e3905..71e2447a 100644 --- a/src/Servant/Common/Req.hs +++ b/src/Servant/Common/Req.hs @@ -19,6 +19,7 @@ import Data.String.Conversions import Data.Text import Data.Text.Encoding import Network.HTTP.Client +import Network.HTTP.Client.TLS import Network.HTTP.Types import Network.URI import Servant.Common.BaseUrl @@ -91,7 +92,7 @@ reqToRequest req (BaseUrl reqScheme reqHost reqPort) = {-# NOINLINE __manager #-} __manager :: MVar Manager -__manager = unsafePerformIO (newManager defaultManagerSettings >>= newMVar) +__manager = unsafePerformIO (newManager tlsManagerSettings >>= newMVar) __withGlobalManager :: (Manager -> IO a) -> IO a __withGlobalManager action = modifyMVar __manager $ \ manager -> do