Add TLS support
This commit is contained in:
parent
83e46f41ef
commit
4228447e91
2 changed files with 3 additions and 1 deletions
|
@ -44,6 +44,7 @@ library
|
||||||
, either
|
, either
|
||||||
, exceptions
|
, exceptions
|
||||||
, http-client
|
, http-client
|
||||||
|
, http-client-tls
|
||||||
, http-types
|
, http-types
|
||||||
, network-uri >= 2.6
|
, network-uri >= 2.6
|
||||||
, safe
|
, safe
|
||||||
|
|
|
@ -19,6 +19,7 @@ import Data.String.Conversions
|
||||||
import Data.Text
|
import Data.Text
|
||||||
import Data.Text.Encoding
|
import Data.Text.Encoding
|
||||||
import Network.HTTP.Client
|
import Network.HTTP.Client
|
||||||
|
import Network.HTTP.Client.TLS
|
||||||
import Network.HTTP.Types
|
import Network.HTTP.Types
|
||||||
import Network.URI
|
import Network.URI
|
||||||
import Servant.Common.BaseUrl
|
import Servant.Common.BaseUrl
|
||||||
|
@ -91,7 +92,7 @@ reqToRequest req (BaseUrl reqScheme reqHost reqPort) =
|
||||||
|
|
||||||
{-# NOINLINE __manager #-}
|
{-# NOINLINE __manager #-}
|
||||||
__manager :: MVar Manager
|
__manager :: MVar Manager
|
||||||
__manager = unsafePerformIO (newManager defaultManagerSettings >>= newMVar)
|
__manager = unsafePerformIO (newManager tlsManagerSettings >>= newMVar)
|
||||||
|
|
||||||
__withGlobalManager :: (Manager -> IO a) -> IO a
|
__withGlobalManager :: (Manager -> IO a) -> IO a
|
||||||
__withGlobalManager action = modifyMVar __manager $ \ manager -> do
|
__withGlobalManager action = modifyMVar __manager $ \ manager -> do
|
||||||
|
|
Loading…
Reference in a new issue