TLS/SSL protocol native implementation (Server and Client)

Version on this page:1.2.18@rev:1
LTS Haskell 21.22:1.6.0
Stackage Nightly 2023-11-28:1.8.0
Latest on Hackage:1.9.0

See all snapshots tls appears in

BSD-3-Clause licensed and maintained by Vincent Hanquez
This version can be pinned in stack with:tls-1.2.18@sha256:9ac7d95e41034d36a962fa5727ecb4e6e8f9e797d00ef6b6675a3b6d9f3b842c,5983

Module documentation for 1.2.18

Native Haskell TLS and SSL protocol implementation for server and client.

This provides a high-level implementation of a sensitive security protocol, eliminating a common set of security issues through the use of the advanced type system, high level constructions and common Haskell features.

Currently implement the SSL3.0, TLS1.0, TLS1.1 and TLS1.2 protocol, and support RSA and Ephemeral (Elliptic curve and regular) Diffie Hellman key exchanges, and many extensions.

Some debug tools linked with tls, are available through the


Version 1.2.18

  • add more tests (network, local)
  • cleanup cipher / bulk code, certificate verify / creation, and digitall signed handling
  • fix handling of DHE ciphers with MS SSL stack that serialize leading zero.

Version 1.2.17

  • Fix an issue of type of key / hash that prevented connection with SChannel.

Version 1.2.16

  • Fix an issue with stream cipher not correctly calculating the internal state, resulting systematically in bad record mac failure during handshake

Version 1.2.15

  • support chain certificate in credentials

Version 1.2.14

  • adding ALPN extension
  • adding support for AEAD, and particularly AES128-GCM
  • Adding support for ECDH
  • Do not support SSL3 by default for security reason.
  • add EnumSafe8 and 16 for specific sized Enum instance that are safer
  • export signatureAndHash parser/encoder
  • add a “known” list of extensions
  • add SignatureAlgorithms extension
  • add Heartbeat extension
  • add support for EC curves and point format extensions
  • add preliminary SessionTicket extension
  • Debug: Add the ability to choose arbitrary cipher in the client hello.

Version 1.2.13

  • Fix compilation with old mtl version

Version 1.2.12

  • Propagate asynchronous exception

Version 1.2.11

  • use hourglass instead of time
  • use tasty instead of test-framework
  • add travis file
  • remove old de-optimisation flag as the bytestring bug is old now and it conflict with cabal check

Version 1.2.10

  • Update x509 dependencies

Version 1.2.9

  • Export TLSParams and HasBackend type names
  • Added FlexibleContexts flag required by ghc-7.9
  • debug: add support for specifying the timeout length in milliseconds.
  • debug: add support for 3DES in simple client

Version 1.2.8

  • add support for 3DES-EDE-CBC-SHA1 (cipher 0xa)

Version 1.2.7

  • repair retrieve certificate validation, and improve fingerprints
  • remove groom from dependency
  • make RecordM an instance of Applicative
  • Fixes the Error_EOF partial pattern match error in exception handling

Version 1.2.6 (23 Mar 2014)

  • Fixed socket backend endless loop when the server does not close connection properly at the TLS level with the close notify alert.
  • Catch Error_EOF in recvData and return empty data.

Version 1.2.5 (23 Mar 2014)

  • Fixed Server key exchange data being parsed without the correct context, leading to not knowing how to parse the structure. The bug happens on efficient server that happens to send the ServerKeyXchg message together with the ServerHello in the same handshake packet. This trigger parsing of all the messages without having set the pending cipher. Delay parsing, when this happen, until we know what to do with it.

Version 1.2.4 (23 Mar 2014)

  • Fixed unrecognized name non-fatal alert after client hello.
  • Add SSL3 to the supported list of version by default.
  • Fix cereal lower bound to 0.4.0 minimum

Version 1.2.3 (22 Mar 2014)

  • Fixed handshake records not being able to span multiples records.