| Safe Haskell | None |
|---|
Data.Conduit.Network.TLS
- data TLSConfig
- tlsConfig :: HostPreference -> Int -> FilePath -> FilePath -> TLSConfig
- tlsHost :: TLSConfig -> HostPreference
- tlsPort :: TLSConfig -> Int
- tlsCertificate :: TLSConfig -> FilePath
- tlsKey :: TLSConfig -> FilePath
- tlsNeedLocalAddr :: TLSConfig -> Bool
- tlsAppData :: Context -> SockAddr -> Maybe SockAddr -> AppData IO
- runTCPServerTLS :: TLSConfig -> Application IO -> IO ()
- data TLSClientConfig m
- tlsClientConfig :: Int -> ByteString -> TLSClientConfig m
- runTLSClient :: (MonadIO m, MonadBaseControl IO m) => TLSClientConfig m -> Application m -> m ()
- tlsClientPort :: TLSClientConfig m -> Int
- tlsClientHost :: TLSClientConfig m -> ByteString
- tlsClientUseTLS :: TLSClientConfig m -> Bool
- tlsClientTLSSettings :: TLSClientConfig m -> TLSSettings
- tlsClientSockSettings :: TLSClientConfig m -> Maybe SockSettings
- tlsClientConnectionContext :: TLSClientConfig m -> Maybe ConnectionContext
Server
Arguments
| :: HostPreference | |
| -> Int | port |
| -> FilePath | certificate |
| -> FilePath | key |
| -> TLSConfig |
Arguments
| :: Context | a TLS context |
| -> SockAddr | remote address |
| -> Maybe SockAddr | local address |
| -> AppData IO |
Create an AppData from an existing tls Context value. This is a lower level function, allowing you to create a connection in any way you want.
Sample usage:
import Network.Simple.TCP.TLS
myapp :: Application IO
...
main = do
cset <- getDefaultClientSettings
connect cset "host" "port" $
(\(ctx, addr) -> myapp $ tlsAppData ctx addr Nothing)
Since 1.0.1
runTCPServerTLS :: TLSConfig -> Application IO -> IO ()Source
Client
data TLSClientConfig m Source
Settings type for TLS client connection.
Since 1.0.2
Arguments
| :: Int | port |
| -> ByteString | host |
| -> TLSClientConfig m |
Smart constructor for TLSClientConfig.
Since 1.0.2
runTLSClient :: (MonadIO m, MonadBaseControl IO m) => TLSClientConfig m -> Application m -> m ()Source
Run an application with the given configuration.
Since 1.0.2
tlsClientPort :: TLSClientConfig m -> IntSource
Since 1.0.2
tlsClientHost :: TLSClientConfig m -> ByteStringSource
Since 1.0.2
tlsClientUseTLS :: TLSClientConfig m -> BoolSource
Default is True. If set to False, will make a non-TLS connection.
Since 1.0.2
tlsClientTLSSettings :: TLSClientConfig m -> TLSSettingsSource
TLS settings to use. If not provided, defaults will be provided.
Since 1.0.2
tlsClientSockSettings :: TLSClientConfig m -> Maybe SockSettingsSource
Socks configuration; default is Nothing. If absent, Socks will not be used.
Since 1.0.2
tlsClientConnectionContext :: TLSClientConfig m -> Maybe ConnectionContextSource
Connection context. Default is Nothing, which will generate a new
context automatically. If you will be making many connections, it's
recommended to call initConnectionContext yourself.
Since 1.0.2