happstack-server-tls-7.1.6.5: extend happstack-server with https:// support (TLS/SSL)

Safe HaskellNone
LanguageHaskell2010

Happstack.Server.Internal.TLS

Description

core functions and types for HTTPS support

Synopsis

Documentation

log' :: Priority -> String -> IO () Source #

wrapper around logM for this module

data TLSConf Source #

configuration for using https://

Constructors

TLSConf 

Fields

nullTLSConf :: TLSConf Source #

a partially complete TLSConf . You must sete tlsCert and tlsKey at a mininum.

data HTTPS Source #

record that holds the Socket and SSLContext needed to start the https:// event loop. Used with simpleHTTPWithSocket'

see also: httpOnSocket

Constructors

HTTPS 

httpsOnSocket Source #

Arguments

:: FilePath

path to ssl certificate

-> FilePath

path to ssl private key

-> Maybe FilePath

path to PEM encoded list of CA certificates

-> Socket

listening socket (on which listen() has been called, but not accept())

-> IO HTTPS 

generate the HTTPS record needed to start the https:// event loop

acceptTLS Source #

Arguments

:: Socket

the socket returned from acceptLite

-> SSLContext 
-> IO SSL 

accept a TLS connection

listenTLS Source #

Arguments

:: TLSConf

tls configuration

-> (Request -> IO Response)

request handler

-> IO () 

https:/ RequestResponse loop

This function initializes SSL, and starts accepting and handling Requests and sending Respones.

Each Request is processed in a separate thread.

listenTLS' :: Int -> Maybe (LogAccess UTCTime) -> HTTPS -> (Request -> IO Response) -> IO () Source #

low-level https:/ RequestResponse loop

This is the low-level loop that reads Requests and sends Respones. It assumes that SSL has already been initialized and that socket is listening.

Each Request is processed in a separate thread.

see also: listenTLS