Modulenetwork-conduit-tls-1.4.0.1Haskell2010
Data.Conduit.Network.TLS
Synopsis
- type ApplicationStartTLS
- type GeneralApplicationStartTLS
- data TLSConfig
- value tlsConfigBS
- value tlsConfig
- value tlsConfigChainBS
- value tlsConfigChain
- value tlsHost
- value tlsPort
- value tlsNeedLocalAddr
- value tlsAppData
- value runTCPServerTLS
- value runGeneralTCPServerTLS
- value runTCPServerStartTLS
- data TLSClientConfig
- value tlsClientConfig
- value runTLSClient
- value runTLSClientStartTLS
- value tlsClientPort
- value tlsClientHost
- value tlsClientUseTLS
- value tlsClientTLSSettings
- value tlsClientSockSettings
- value tlsClientConnectionContext
- value sourceConnection
- value sinkConnection
- Packagenetwork-conduit-tls-1.4.0.1
- Exports26
- LanguageHaskell2010
- LicenceMIT
- SourceTLS.hs
Common
type GeneralApplicationStartTLS (m :: Type -> Type) a = (AppData, (AppData -> m ()) -> m ()) -> m aServer
tlsConfigBS :: HostPreference-> Intport
-> ByteStringCertificate raw data
-> ByteStringKey file raw data
-> TLSConfig
allow to build a server config directly from raw bytestring data (exact same string as if the certificates were read from the filesystem). this enables to plug another backend to fetch certifcates (other than FS)
tlsConfigChainBS :: HostPreference-> IntPort
-> ByteStringCertificate raw data
-> [ByteString]Chain certificate raw data
-> ByteStringKey file raw data
-> TLSConfig
Like tlsConfigBS, but also allow specifying chain certificates.
Since 1.1.1
tlsConfigChain Like tlsConfig, but also allow specifying chain certificates.
Since 1.1.1
tlsAppData 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
Like runTCPServerTLS, but monad can be any instance of MonadUnliftIO.
Note that any changes to the monadic state performed by individual client handlers will be discarded. If you have mutable state you want to share among multiple handlers, you need to use some kind of mutable variables.
Since 1.1.2
run a server un-crypted but also pass a call-back to trigger a StartTLS handshake on the underlying connection
Sample usage:
runTCPServerStartTLS serverConfig $ \(appData,startTLS) -> do
abortTLS <- doSomethingInClear appData
unless abortTLS $ startTls $ \appDataTls -> do
doSomethingSSL appDataTlsClient
Settings type for TLS client connection.
Since 1.0.2
Smart constructor for TLSClientConfig.
Since 1.0.2
Run an application with the given configuration.
Since 1.0.2
Run an application with the given configuration. starting with a clear connection but provide also a call back to trigger a StartTLS handshake on the connection
Since 1.0.2
Since 1.0.2
Since 1.0.2
Default is True. If set to False, will make a non-TLS connection.
Since 1.0.2
TLS settings to use. If not provided, defaults will be provided.
Since 1.0.2
Socks configuration; default is Nothing. If absent, Socks will not be used.
Since 1.0.2
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
Misc
Read from a Connection.
Write to a Connection.