-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | http-client TLS backend using Rustls -- -- Make HTTPS connections using http-client and Rustls. @package http-client-rustls @version 0.0.1.0 -- | Make HTTPS connections using http-client and Rustls. -- --
-- >>> import qualified Rustls
--
-- >>> import qualified Network.HTTP.Client as HTTP
--
-- >>> :{
-- newRustlsManager :: IO HTTP.Manager
-- newRustlsManager = do
-- clientConfig <-
-- Rustls.buildClientConfig $
-- Rustls.defaultClientConfigBuilder serverCertVerifier
-- HTTP.newManager $ rustlsManagerSettings clientConfig
-- where
-- -- For now, rustls-ffi does not provide a built-in way to access
-- -- the OS certificate store.
-- serverCertVerifier =
-- Rustls.ServerCertVerifier
-- { Rustls.serverCertVerifierCertificates =
-- pure $
-- Rustls.PemCertificatesFromFile
-- "/etc/ssl/certs/ca-certificates.crt"
-- Rustls.PEMCertificateParsingStrict,
-- Rustls.serverCertVerifierCRLs = []
-- }
--
-- >>> :}
--
--
--
-- >>> :{
-- example = do
-- mgr <- newRustlsManager -- this should be shared across multiple requests
-- req <- HTTP.parseUrlThrow "https://example.org"
-- res <- HTTP.httpLbs req mgr
-- print $ HTTP.responseBody res
-- :}
--
module Network.HTTP.Client.Rustls
-- | Get TLS-enabled HTTP ManagerSettings from a Rustls
-- ClientConfig, consumable via newManager.
rustlsManagerSettings :: ClientConfig -> ManagerSettings