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

Portabilityunknown
Stabilityexperimental
MaintainerVincent Hanquez <vincent@snarc.org>

Network.TLS.Client

Contents

Description

the Client module contains the necessary calls to create a connecting TLS socket aka. a client socket.

Synopsis

Documentation

data TLSClientParams Source

Constructors

TLSClientParams 

Fields

cpConnectVersion :: Version

client version we're sending by default

cpAllowedVersions :: [Version]

allowed versions from the server

cpSession :: Maybe [Word8]

session for this connection

cpCiphers :: [Cipher]

all ciphers for this connection

cpCertificate :: Maybe Certificate

an optional client certificate

cpCallbacks :: TLSClientCallbacks

user callbacks

data TLSClientCallbacks Source

Constructors

TLSClientCallbacks 

Fields

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

optional callback to verify certificates

newtype TLSClient m a Source

Constructors

TLSClient 

Instances

low level packet sending receiving.

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

receive a single TLS packet or on error a TLSError

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

send a single TLS packet

API, warning probably subject to change

connect :: Handle -> TLSClient IO ()Source

connect through a handle as a new TLS connection.

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

sendData sends a bunch of data

recvData :: Handle -> TLSClient IO ByteStringSource

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

close :: Handle -> TLSClient 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