Safe Haskell | None |
---|---|
Language | Haskell98 |
HTTP over SSL/TLS support for Warp via the TLS package.
- data TLSSettings
- certFile :: TLSSettings -> FilePath
- keyFile :: TLSSettings -> FilePath
- onInsecure :: TLSSettings -> OnInsecure
- tlsLogging :: TLSSettings -> Logging
- tlsAllowedVersions :: TLSSettings -> [Version]
- tlsCiphers :: TLSSettings -> [Cipher]
- tlsWantClientCert :: TLSSettings -> Bool
- tlsServerHooks :: TLSSettings -> ServerHooks
- defaultTlsSettings :: TLSSettings
- tlsSettings :: FilePath -> FilePath -> TLSSettings
- tlsSettingsMemory :: ByteString -> ByteString -> TLSSettings
- tlsSettingsChain :: FilePath -> [FilePath] -> FilePath -> TLSSettings
- tlsSettingsChainMemory :: ByteString -> [ByteString] -> ByteString -> TLSSettings
- data OnInsecure
- runTLS :: TLSSettings -> Settings -> Application -> IO ()
- runTLSSocket :: TLSSettings -> Settings -> Socket -> Application -> IO ()
- data WarpTLSException = InsecureConnectionDenied
Settings
data TLSSettings Source
certFile :: TLSSettings -> FilePath Source
File containing the certificate.
keyFile :: TLSSettings -> FilePath Source
File containing the key
onInsecure :: TLSSettings -> OnInsecure Source
Do we allow insecure connections with this server as well? Default is a simple text response stating that a secure connection is required.
Since 1.4.0
tlsLogging :: TLSSettings -> Logging Source
tlsAllowedVersions :: TLSSettings -> [Version] Source
The TLS versions this server accepts.
Default: '[TLS.TLS10,TLS.TLS11,TLS.TLS12]'.
Since 1.4.2
tlsCiphers :: TLSSettings -> [Cipher] Source
The TLS ciphers this server accepts.
Default: '[TLSExtra.cipher_AES128_SHA1, TLSExtra.cipher_AES256_SHA1, TLSEtra.cipher_RC4_128_MD5, TLSExtra.cipher_RC4_128_SHA1]'
Since 1.4.2
tlsWantClientCert :: TLSSettings -> Bool Source
Whether or not to demand a certificate from the client. If this is set to True, you must handle received certificates in a server hook or all connections will fail.
Default: False
Since 3.0.2
tlsServerHooks :: TLSSettings -> ServerHooks Source
The server-side hooks called by the tls package, including actions to take when a client certificate is received. See the Network.TLS module for details.
Default: def
Since 3.0.2
defaultTlsSettings :: TLSSettings Source
Default TLSSettings
. Use this to create TLSSettings
with the field record name.
:: FilePath | Certificate file |
-> FilePath | Key file |
-> TLSSettings |
A smart constructor for TLSSettings
.
:: ByteString | Certificate bytes |
-> ByteString | Key bytes |
-> TLSSettings |
A smart constructor for TLSSettings
, but uses in-memory representations
of the certificate and key
Since 3.0.1
:: FilePath | Certificate file |
-> [FilePath] | Chain certificate files |
-> FilePath | Key file |
-> TLSSettings |
A smart constructor for TLSSettings
that allows specifying
chain certificates.
Since 3.0.3
:: ByteString | Certificate bytes |
-> [ByteString] | Chain certificate bytes |
-> ByteString | Key bytes |
-> TLSSettings |
A smart constructor for TLSSettings
, but uses in-memory representations
of the certificate and key
Since 3.0.3
data OnInsecure Source
An action when a plain HTTP comes to HTTP over TLS/SSL port.
Runner
runTLS :: TLSSettings -> Settings -> Application -> IO () Source
Running Application
with TLSSettings
and Settings
.
runTLSSocket :: TLSSettings -> Settings -> Socket -> Application -> IO () Source
Running Application
with TLSSettings
and Settings
using
specified Socket
.