tcp-streams-openssl-0.6.0.0: Tcp streams using openssl for tls support.

Safe HaskellNone
LanguageHaskell2010

Data.OpenSSLSetting

Contents

Description

Helpers for setting up a tls connection with HsOpenSSL package, for further customization, please refer to HsOpenSSL package.

Note, functions in this module will throw error if can't load certificates or CA store.

Synopsis

choose a CAStore

make TLS settings

makeClientSSLContext Source

Arguments

:: TrustedCAStore

trusted certificates.

-> IO SSLContext 

make a simple SSLContext that will validate server and use tls connection without providing client's own certificate. suitable for connecting server which don't validate clients.

makeClientSSLContext' Source

Arguments

:: FilePath

public certificate (X.509 format).

-> [FilePath]

chain certificate (X.509 format).

-> FilePath

private key associated.

-> TrustedCAStore

server will use these certificates to validate clients.

-> IO SSLContext 

make a simple SSLContext that will validate server and use tls connection while providing client's own certificate. suitable for connecting server which validate clients.

The chain certificate must be in PEM format and must be sorted starting with the subject's certificate (actual client or server certificate), followed by intermediate CA certificates if applicable, and ending at the highest level (root) CA.

makeServerSSLContext Source

Arguments

:: FilePath

public certificate (X.509 format).

-> [FilePath]

chain certificate (X.509 format).

-> FilePath

private key associated.

-> IO SSLContext 

make a simple SSLContext for server without validating client's certificate.

makeServerSSLContext' Source

Arguments

:: FilePath

public certificate (X.509 format).

-> [FilePath]

chain certificates (X.509 format).

-> FilePath

private key associated.

-> TrustedCAStore

server will use these certificates to validate clients.

-> IO SSLContext 

make a SSLConext that also validating client's certificate.

This's an alias to makeClientSSLContext'.