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

Safe HaskellNone

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

tlsPort :: Int
 
tlsCert :: FilePath
 
tlsKey :: FilePath
 
tlsCA :: Maybe FilePath
 
tlsTimeout :: Int
 
tlsLogAccess :: Maybe (LogAccess UTCTime)
 
tlsValidator :: Maybe (Response -> IO Response)

a function to validate the output on-the-fly

nullTLSConf :: TLSConfSource

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 

httpsOnSocketSource

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 :: HTTPS -> IO (Socket, SSL, HostName, PortNumber)Source

accept a TLS connection

listenTLSSource

Arguments

:: TLSConf

tls configuration

-> (Request -> IO Response)

request handler

-> IO () 

https: 'Request'/'Response' 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) -> Socket -> HTTPS -> (Request -> IO Response) -> IO ()Source

low-level https: 'Request'/'Response' 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