http-client-tls-0.3.6.4: http-client backend using the connection package and tls library

Safe Haskell | None
Language | Haskell2010

Network.HTTP.Client.TLS

Contents

- Settings
- Digest authentication
- Global manager

Description

Support for making connections via the connection package and, in turn, the tls package suite.

Recommended reading: https://haskell-lang.org/library/http-client

Synopsis

- tlsManagerSettings :: ManagerSettings
- mkManagerSettings :: TLSSettings -> Maybe SockSettings -> ManagerSettings
- mkManagerSettingsContext :: Maybe ConnectionContext -> TLSSettings -> Maybe SockSettings -> ManagerSettings
- newTlsManager :: MonadIO m => m Manager
- newTlsManagerWith :: MonadIO m => ManagerSettings -> m Manager
- applyDigestAuth :: (MonadIO m, MonadThrow n) => ByteString -> ByteString -> Request -> Manager -> m (n Request)
- data DigestAuthException = DigestAuthException Request (Response ()) DigestAuthExceptionDetails
- data DigestAuthExceptionDetails
  - = UnexpectedStatusCode
  - | MissingWWWAuthenticateHeader
  - | WWWAuthenticateIsNotDigest
  - | MissingRealm
  - | MissingNonce
- displayDigestAuthException :: DigestAuthException -> String
- getGlobalManager :: IO Manager
- setGlobalManager :: Manager -> IO ()

# Settings

tlsManagerSettings :: ManagerSettings Source #

Default TLS-enabled manager settings

mkManagerSettings :: TLSSettings -> Maybe SockSettings -> ManagerSettings Source #

Create a TLS-enabled `ManagerSettings` with the given `TLSSettings` and `SockSettings`

mkManagerSettingsContext :: Maybe ConnectionContext -> TLSSettings -> Maybe SockSettings -> ManagerSettings Source #

Same as `mkManagerSettings`, but also takes an optional `ConnectionContext`. Providing this externally can be an optimization, though that may change in the future. For more information, see:

https://github.com/snoyberg/http-client/pull/227

Since: 0.3.2

newTlsManager :: MonadIO m => m Manager Source #

Load up a new TLS manager with default settings, respecting proxy environment variables.

Since: 0.3.4

newTlsManagerWith :: MonadIO m => ManagerSettings -> m Manager Source #

Load up a new TLS manager based upon specified settings, respecting proxy environment variables.

Since: 0.3.5

# Digest authentication

applyDigestAuth Source #

Arguments

:: (MonadIO m, MonadThrow n) |
=> ByteString | username
-> ByteString | password
-> Request |
-> Manager |
-> m (n Request) |

Apply digest authentication to this request.

Note that this function will need to make an HTTP request to the server in order to get the nonce, thus the need for a `Manager` and to live in `IO`. This also means that the request body will be sent to the server. If the request body in the supplied `Request` can only be read once, you should replace it with a dummy value.

In the event of successfully generating a digest, this will return a `Just` value. If there is any problem with generating the digest, it will return `Nothing`.

Since: 0.3.1

data DigestAuthException Source #

Generated by `applyDigestAuth` when it is unable to apply the digest credentials to the request.

Since: 0.3.3

Constructors

DigestAuthException Request (Response ()) DigestAuthExceptionDetails |

#### Instances

Instances details

Exception DigestAuthException Source # |
Instance details Defined in Network.HTTP.Client.TLS Methods toException :: DigestAuthException -> SomeException Source # fromException :: SomeException -> Maybe DigestAuthException Source # displayException :: DigestAuthException -> String Source # backtraceDesired :: DigestAuthException -> Bool Source #
Show DigestAuthException Source # |
Instance details Defined in Network.HTTP.Client.TLS Methods showsPrec :: Int -> DigestAuthException -> ShowS Source # show :: DigestAuthException -> String Source # showList :: [DigestAuthException] -> ShowS Source #

data DigestAuthExceptionDetails Source #

Detailed explanation for failure for `DigestAuthException`

Since: 0.3.3

Constructors

UnexpectedStatusCode |
MissingWWWAuthenticateHeader |
WWWAuthenticateIsNotDigest |
MissingRealm |
MissingNonce |

#### Instances

Instances details

Read DigestAuthExceptionDetails Source # |
Instance details Defined in Network.HTTP.Client.TLS Methods readsPrec :: Int -> ReadS DigestAuthExceptionDetails Source # readList :: ReadS [DigestAuthExceptionDetails] Source # readPrec :: ReadPrec DigestAuthExceptionDetails Source # readListPrec :: ReadPrec [DigestAuthExceptionDetails] Source #
Show DigestAuthExceptionDetails Source # |
Instance details Defined in Network.HTTP.Client.TLS Methods showsPrec :: Int -> DigestAuthExceptionDetails -> ShowS Source # show :: DigestAuthExceptionDetails -> String Source # showList :: [DigestAuthExceptionDetails] -> ShowS Source #
Eq DigestAuthExceptionDetails Source # |
Instance details Defined in Network.HTTP.Client.TLS Methods (==) :: DigestAuthExceptionDetails -> DigestAuthExceptionDetails -> Bool Source # (/=) :: DigestAuthExceptionDetails -> DigestAuthExceptionDetails -> Bool Source #
Ord DigestAuthExceptionDetails Source # |

Instance details

Defined in Network.HTTP.Client.TLS

Methods

compare :: DigestAuthExceptionDetails -> DigestAuthExceptionDetails -> Ordering Source #

(<) :: DigestAuthExceptionDetails -> DigestAuthExceptionDetails -> Bool Source #

(<=) :: DigestAuthExceptionDetails -> DigestAuthExceptionDetails -> Bool Source #

(>) :: DigestAuthExceptionDetails -> DigestAuthExceptionDetails -> Bool Source #

(>=) :: DigestAuthExceptionDetails -> DigestAuthExceptionDetails -> Bool Source #

max :: DigestAuthExceptionDetails -> DigestAuthExceptionDetails -> DigestAuthExceptionDetails Source #

min :: DigestAuthExceptionDetails -> DigestAuthExceptionDetails -> DigestAuthExceptionDetails Source #

displayDigestAuthException :: DigestAuthException -> String Source #

User friendly display of a `DigestAuthException`

Since: 0.3.3

# Global manager

getGlobalManager :: IO Manager Source #

Get the current global `Manager`

Since: 0.2.4

setGlobalManager :: Manager -> IO () Source #

Set the current global `Manager`

Since: 0.2.4