tls-0.3: TLS/SSL protocol native implementation (Server and Client)

Portabilityunknown
Stabilityexperimental
MaintainerVincent Hanquez <vincent@snarc.org>

Network.TLS.Server

Contents

Description

the Server module contains the necessary calls to create a listening TLS socket aka. a server socket.

Synopsis

Documentation

data TLSServerParams Source

Constructors

TLSServerParams 

Fields

spAllowedVersions :: [Version]

allowed versions that we can use

spSessions :: [[Word8]]

placeholder for futur known sessions

spCiphers :: [Cipher]

all ciphers that the server side support

spCertificate :: Maybe TLSServerCert

the certificate we serve to the client

spWantClientCert :: Bool

configure if we do a cert request to the client

spCallbacks :: TLSServerCallbacks

user callbacks

data TLSServerCallbacks Source

Constructors

TLSServerCallbacks 

Fields

cbCertificates :: Maybe ([Certificate] -> IO Bool)

optional callback to verify certificates

data TLSStateServer Source

Instances

Monad m => MonadState TLSStateServer (TLSServer m) 

low level packet sending receiving.

recvPacket :: Handle -> TLSServer IO (Either TLSError [Packet])Source

receive a single TLS packet or on error a TLSError

sendPacket :: Handle -> Packet -> TLSServer IO ()Source

send a single TLS packet

API, warning probably subject to change

listen :: Handle -> TLSServer IO ()Source

listen on a handle to a new TLS connection.

sendData :: Handle -> ByteString -> TLSServer IO ()Source

sendData sends a bunch of data

recvData :: Handle -> TLSServer IO ByteStringSource

recvData get data out of Data packet, and automatically renegociate if - a Handshake ClientHello is received

close :: Handle -> TLSServer IO ()Source

close a TLS connection. - note that it doesn't close the handle, but just signal we're going to close - the connection to the other side