HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Modulenetwork-conduit-tls-1.4.0Haskell2010

Data.Conduit.Network.TLS

  • 4 types
  • 22 values

Common

2 declarations

Server

12 declarations
valuetlsConfigBS
  1. :: HostPreference
  2. -> Int

    port

  3. -> ByteString

    Certificate raw data

  4. -> ByteString

    Key file raw data

  5. -> 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)

valuetlsAppData
  1. :: Context

    a TLS context

  2. -> SockAddr

    remote address

  3. -> Maybe SockAddr

    local address

  4. -> AppData
#

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

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 appDataTls

Client

10 declarations
datadata TLSClientConfig
#

Settings type for TLS client connection.

Since 1.0.2

Misc

2 declarations