happstack-server-tls-cryptonite-0.1.1: Extend happstack-server with native HTTPS support (TLS/SSL)

Safe HaskellNone
LanguageHaskell98

Happstack.Server.Internal.Cryptonite.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 :: 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

-> ServerParams 
-> IO Context 

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