HORIZON HASKELLDocslts/ghc-10.0.xfc4e5982026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · fc4e598 · 2026-10-11

Moduletls-2.4.9Haskell2010

Network.TLS.Internal

  • 141 types
  • 1 class
  • 140 values
  • Packagetls-2.4.9
  • Exports443
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceExtension.hs
valuesupportedExtensions :: [ExtensionID]
#

all supported extensions by the implementation

newtypenewtype Group
#

Constructors

Instances5Eq, Show, Generic, Serialise, Rep
newtypenewtype ApplicationLayerProtocolNegotiation
#

Application Layer Protocol Negotiation (ALPN)

Constructors

Instances3Eq, Show, Extension
  • Eq ApplicationLayerProtocolNegotiationDefined in tls-2.4.9 · Network.TLS.Extension
  • Show ApplicationLayerProtocolNegotiationDefined in tls-2.4.9 · Network.TLS.Extension
  • Extension ApplicationLayerProtocolNegotiationDefined in tls-2.4.9 · Network.TLS.Extension
newtypenewtype CertificateAuthorities
#

Constructors

Instances3Eq, Show, Extension
  • Eq CertificateAuthoritiesDefined in tls-2.4.9 · Network.TLS.Extension
  • Show CertificateAuthoritiesDefined in tls-2.4.9 · Network.TLS.Extension
  • Extension CertificateAuthoritiesDefined in tls-2.4.9 · Network.TLS.Extension
newtypenewtype CertificateCompressionAlgorithm
#

Constructors

  • CertificateCompressionAlgorithm Word16
Instances2Eq, Show
  • Eq CertificateCompressionAlgorithmDefined in tls-2.4.9 · Network.TLS.Extension
  • Show CertificateCompressionAlgorithmDefined in tls-2.4.9 · Network.TLS.Extension
patternpattern CCA_Brotli :: CertificateCompressionAlgorithm
#
patternpattern CCA_Zlib :: CertificateCompressionAlgorithm
#
patternpattern CCA_Zstd :: CertificateCompressionAlgorithm
#
newtypenewtype CompressCertificate
#

Constructors

  • CompressCertificate [CertificateCompressionAlgorithm]
Instances3Eq, Show, Extension
  • Eq CompressCertificateDefined in tls-2.4.9 · Network.TLS.Extension
  • Show CompressCertificateDefined in tls-2.4.9 · Network.TLS.Extension
  • Extension CompressCertificateDefined in tls-2.4.9 · Network.TLS.Extension
newtypenewtype Cookie
#

Constructors

Instances3Eq, Show, Extension
  • Eq CookieDefined in tls-2.4.9 · Network.TLS.Extension
  • Show CookieDefined in tls-2.4.9 · Network.TLS.Extension
  • Extension CookieDefined in tls-2.4.9 · Network.TLS.Extension
newtypenewtype EarlyDataIndication
#

Constructors

Instances3Eq, Show, Extension
  • Eq EarlyDataIndicationDefined in tls-2.4.9 · Network.TLS.Extension
  • Show EarlyDataIndicationDefined in tls-2.4.9 · Network.TLS.Extension
  • Extension EarlyDataIndicationDefined in tls-2.4.9 · Network.TLS.Extension
newtypenewtype EcPointFormat
#

Constructors

  • EcPointFormat
    • fromEcPointFormat :: Word8
Instances2Eq, Show
  • Eq EcPointFormatDefined in tls-2.4.9 · Network.TLS.Extension
  • Show EcPointFormatDefined in tls-2.4.9 · Network.TLS.Extension
patternpattern EcPointFormat_AnsiX962_compressed_char2 :: EcPointFormat
#
patternpattern EcPointFormat_AnsiX962_compressed_prime :: EcPointFormat
#
patternpattern EcPointFormat_Uncompressed :: EcPointFormat
#
newtypenewtype EcPointFormatsSupported
#

Constructors

  • EcPointFormatsSupported [EcPointFormat]
Instances3Eq, Show, Extension
  • Eq EcPointFormatsSupportedDefined in tls-2.4.9 · Network.TLS.Extension
  • Show EcPointFormatsSupportedDefined in tls-2.4.9 · Network.TLS.Extension
  • Extension EcPointFormatsSupportedDefined in tls-2.4.9 · Network.TLS.Extension
newtypenewtype EchOuterExtensions
#

Constructors

Instances3Eq, Show, Extension
  • Eq EchOuterExtensionsDefined in tls-2.4.9 · Network.TLS.Extension
  • Show EchOuterExtensionsDefined in tls-2.4.9 · Network.TLS.Extension
  • Extension EchOuterExtensionsDefined in tls-2.4.9 · Network.TLS.Extension
datadata EncryptedClientHello
#

Encrypted Client Hello

Constructors

Instances3Eq, Show, Extension
  • Eq EncryptedClientHelloDefined in tls-2.4.9 · Network.TLS.Extension
  • Show EncryptedClientHelloDefined in tls-2.4.9 · Network.TLS.Extension
  • Extension EncryptedClientHelloDefined in tls-2.4.9 · Network.TLS.Extension
datadata ExtendedMainSecret
#

Extended Main Secret

Instances3Eq, Show, Extension
  • Eq ExtendedMainSecretDefined in tls-2.4.9 · Network.TLS.Extension
  • Show ExtendedMainSecretDefined in tls-2.4.9 · Network.TLS.Extension
  • Extension ExtendedMainSecretDefined in tls-2.4.9 · Network.TLS.Extension
classclass Extension a where
#

Extension class to transform bytes to and from a high level Extension type.

Methods

  • extensionID :: a -> ExtensionID
  • extensionDecode :: MessageType -> ByteString -> Maybe a

    Decode an extension's body as it appears in the given message.

    Nothing covers both ways this can fail to produce a value: a body that does not parse, and a message the extension is not defined in. Both reach the peer the same way, as the decode_error alert that lookupAndDecode and lookupAndDecodeAndDo raise, which is what either case warrants.

    So the last clause of an instance is Nothing, never error: the message type is chosen by this library rather than by the peer, so an unhandled one would be our own bug -- and turning our bug into an ErrorCall thrown from pure code, out through the handshake and into the application, is a worse answer than dropping the one connection.

  • extensionEncode :: a -> ByteString
Instances23Extension, …
  • Extension ApplicationLayerProtocolNegotiationDefined in tls-2.4.9 · Network.TLS.Extension
  • Extension CertificateAuthoritiesDefined in tls-2.4.9 · Network.TLS.Extension
  • Extension CompressCertificateDefined in tls-2.4.9 · Network.TLS.Extension
  • Extension CookieDefined in tls-2.4.9 · Network.TLS.Extension
  • Extension EarlyDataIndicationDefined in tls-2.4.9 · Network.TLS.Extension
  • Extension EcPointFormatsSupportedDefined in tls-2.4.9 · Network.TLS.Extension
  • Extension EchOuterExtensionsDefined in tls-2.4.9 · Network.TLS.Extension
  • Extension EncryptedClientHelloDefined in tls-2.4.9 · Network.TLS.Extension
  • Extension ExtendedMainSecretDefined in tls-2.4.9 · Network.TLS.Extension
  • Extension HeartBeatDefined in tls-2.4.9 · Network.TLS.Extension
  • Extension KeyShareDefined in tls-2.4.9 · Network.TLS.Extension
  • Extension MaxFragmentLengthDefined in tls-2.4.9 · Network.TLS.Extension
  • Extension PostHandshakeAuthDefined in tls-2.4.9 · Network.TLS.Extension
  • Extension PreSharedKeyDefined in tls-2.4.9 · Network.TLS.Extension
  • Extension PskKeyExchangeModesDefined in tls-2.4.9 · Network.TLS.Extension
  • Extension RecordSizeLimitDefined in tls-2.4.9 · Network.TLS.Extension
  • Extension SecureRenegotiationDefined in tls-2.4.9 · Network.TLS.Extension
  • Extension ServerNameDefined in tls-2.4.9 · Network.TLS.Extension
  • Extension SessionTicketDefined in tls-2.4.9 · Network.TLS.Extension
  • Extension SignatureAlgorithmsDefined in tls-2.4.9 · Network.TLS.Extension
  • Extension SignatureAlgorithmsCertDefined in tls-2.4.9 · Network.TLS.Extension
  • Extension SupportedGroupsDefined in tls-2.4.9 · Network.TLS.Extension
  • Extension SupportedVersionsDefined in tls-2.4.9 · Network.TLS.Extension
patternpattern EID_ApplicationLayerProtocolNegotiation :: ExtensionID
#
patternpattern EID_CertificateAuthorities :: ExtensionID
#
patternpattern EID_ClientCertificateType :: ExtensionID
#
patternpattern EID_ClientCertificateUrl :: ExtensionID
#
patternpattern EID_EncryptedClientHello :: ExtensionID
#
patternpattern EID_ServerCertificateType :: ExtensionID
#
patternpattern EID_SignatureAlgorithmsCert :: ExtensionID
#
patternpattern EID_SignedCertificateTimestamp :: ExtensionID
#
newtypenewtype HeartBeat
#

Constructors

  • HeartBeat HeartBeatMode
Instances3Eq, Show, Extension
  • Eq HeartBeatDefined in tls-2.4.9 · Network.TLS.Extension
  • Show HeartBeatDefined in tls-2.4.9 · Network.TLS.Extension
  • Extension HeartBeatDefined in tls-2.4.9 · Network.TLS.Extension
newtypenewtype HeartBeatMode
#

Constructors

  • HeartBeatMode
    • fromHeartBeatMode :: Word8
Instances2Eq, Show
  • Eq HeartBeatModeDefined in tls-2.4.9 · Network.TLS.Extension
  • Show HeartBeatModeDefined in tls-2.4.9 · Network.TLS.Extension
patternpattern HeartBeat_PeerAllowedToSend :: HeartBeatMode
#
patternpattern HeartBeat_PeerNotAllowedToSend :: HeartBeatMode
#
datadata KeyShare
#

Constructors

  • KeyShareClientHello [KeyShareEntry]
  • KeyShareServerHello KeyShareEntry
  • KeyShareHRR Group
Instances3Eq, Show, Extension
  • Eq KeyShareDefined in tls-2.4.9 · Network.TLS.Extension
  • Show KeyShareDefined in tls-2.4.9 · Network.TLS.Extension
  • Extension KeyShareDefined in tls-2.4.9 · Network.TLS.Extension
datadata KeyShareEntry
#

Constructors

  • KeyShareEntry
Instances2Eq, Show
  • Eq KeyShareEntryDefined in tls-2.4.9 · Network.TLS.Extension
  • Show KeyShareEntryDefined in tls-2.4.9 · Network.TLS.Extension
datadata MaxFragmentLength
#

Max fragment extension with length from 512 bytes to 4096 bytes

RFC 6066 defines: If a server receives a maximum fragment length negotiation request for a value other than the allowed values, it MUST abort the handshake with an "illegal_parameter" alert.

So, if a server receives MaxFragmentLengthOther, it must send the alert.

Constructors

Instances3Eq, Show, Extension
  • Eq MaxFragmentLengthDefined in tls-2.4.9 · Network.TLS.Extension
  • Show MaxFragmentLengthDefined in tls-2.4.9 · Network.TLS.Extension
  • Extension MaxFragmentLengthDefined in tls-2.4.9 · Network.TLS.Extension
datadata PostHandshakeAuth
#
Instances3Eq, Show, Extension
  • Eq PostHandshakeAuthDefined in tls-2.4.9 · Network.TLS.Extension
  • Show PostHandshakeAuthDefined in tls-2.4.9 · Network.TLS.Extension
  • Extension PostHandshakeAuthDefined in tls-2.4.9 · Network.TLS.Extension
datadata PreSharedKey
#

Constructors

  • PreSharedKeyClientHello [PskIdentity] [ByteString]
  • PreSharedKeyServerHello Int
Instances3Eq, Show, Extension
  • Eq PreSharedKeyDefined in tls-2.4.9 · Network.TLS.Extension
  • Show PreSharedKeyDefined in tls-2.4.9 · Network.TLS.Extension
  • Extension PreSharedKeyDefined in tls-2.4.9 · Network.TLS.Extension
datadata PskIdentity
#

Constructors

Instances2Eq, Show
  • Eq PskIdentityDefined in tls-2.4.9 · Network.TLS.Extension
  • Show PskIdentityDefined in tls-2.4.9 · Network.TLS.Extension
newtypenewtype PskKexMode
#

Constructors

  • PskKexMode
Instances2Eq, Show
  • Eq PskKexModeDefined in tls-2.4.9 · Network.TLS.Extension
  • Show PskKexModeDefined in tls-2.4.9 · Network.TLS.Extension
patternpattern PSK_DHE_KE :: PskKexMode
#
patternpattern PSK_KE :: PskKexMode
#
newtypenewtype PskKeyExchangeModes
#

Constructors

  • PskKeyExchangeModes [PskKexMode]
Instances3Eq, Show, Extension
  • Eq PskKeyExchangeModesDefined in tls-2.4.9 · Network.TLS.Extension
  • Show PskKeyExchangeModesDefined in tls-2.4.9 · Network.TLS.Extension
  • Extension PskKeyExchangeModesDefined in tls-2.4.9 · Network.TLS.Extension
newtypenewtype RecordSizeLimit
#

Constructors

Instances3Eq, Show, Extension
  • Eq RecordSizeLimitDefined in tls-2.4.9 · Network.TLS.Extension
  • Show RecordSizeLimitDefined in tls-2.4.9 · Network.TLS.Extension
  • Extension RecordSizeLimitDefined in tls-2.4.9 · Network.TLS.Extension
datadata SecureRenegotiation
#

Secure Renegotiation

Constructors

Instances3Eq, Show, Extension
  • Eq SecureRenegotiationDefined in tls-2.4.9 · Network.TLS.Extension
  • Show SecureRenegotiationDefined in tls-2.4.9 · Network.TLS.Extension
  • Extension SecureRenegotiationDefined in tls-2.4.9 · Network.TLS.Extension
newtypenewtype ServerName
#

Server Name extension including the name type and the associated name. the associated name decoding is dependent of its name type. name type = 0 : hostname

Constructors

  • ServerName [ServerNameType]
Instances3Eq, Show, Extension
  • Eq ServerNameDefined in tls-2.4.9 · Network.TLS.Extension
  • Show ServerNameDefined in tls-2.4.9 · Network.TLS.Extension
  • Extension ServerNameDefined in tls-2.4.9 · Network.TLS.Extension
datadata ServerNameType
#

Constructors

Instances2Eq, Show
  • Eq ServerNameTypeDefined in tls-2.4.9 · Network.TLS.Extension
  • Show ServerNameTypeDefined in tls-2.4.9 · Network.TLS.Extension
newtypenewtype SessionTicket
#

Constructors

Instances3Eq, Show, Extension
  • Eq SessionTicketDefined in tls-2.4.9 · Network.TLS.Extension
  • Show SessionTicketDefined in tls-2.4.9 · Network.TLS.Extension
  • Extension SessionTicketDefined in tls-2.4.9 · Network.TLS.Extension
newtypenewtype SignatureAlgorithms
#

Constructors

Instances3Eq, Show, Extension
  • Eq SignatureAlgorithmsDefined in tls-2.4.9 · Network.TLS.Extension
  • Show SignatureAlgorithmsDefined in tls-2.4.9 · Network.TLS.Extension
  • Extension SignatureAlgorithmsDefined in tls-2.4.9 · Network.TLS.Extension
newtypenewtype SignatureAlgorithmsCert
#

Constructors

Instances3Eq, Show, Extension
  • Eq SignatureAlgorithmsCertDefined in tls-2.4.9 · Network.TLS.Extension
  • Show SignatureAlgorithmsCertDefined in tls-2.4.9 · Network.TLS.Extension
  • Extension SignatureAlgorithmsCertDefined in tls-2.4.9 · Network.TLS.Extension
newtypenewtype SupportedGroups
#

Constructors

Instances3Eq, Show, Extension
  • Eq SupportedGroupsDefined in tls-2.4.9 · Network.TLS.Extension
  • Show SupportedGroupsDefined in tls-2.4.9 · Network.TLS.Extension
  • Extension SupportedGroupsDefined in tls-2.4.9 · Network.TLS.Extension
datadata SupportedVersions
#

Constructors

  • SupportedVersionsClientHello [Version]
  • SupportedVersionsServerHello Version
Instances3Eq, Show, Extension
  • Eq SupportedVersionsDefined in tls-2.4.9 · Network.TLS.Extension
  • Show SupportedVersionsDefined in tls-2.4.9 · Network.TLS.Extension
  • Extension SupportedVersionsDefined in tls-2.4.9 · Network.TLS.Extension
valuecheckChangeCipherSpec :: Fragment a -> Either TLSError ()
#

A ChangeCipherSpec is the single byte 1. RFC 8446 Section 5 answers any other value with unexpected_message, and TLS 1.2, which does not say, is answered the same way: a record of two of them included.

valueencodePacket12
  1. :: Monoid bytes
  2. => Context
  3. -> RecordLayer bytes
  4. -> Packet
  5. -> IO (Either TLSError bytes)
#

encodePacket transform a packet into marshalled data related to current state and updating state on the go

valueupdateTranscriptHash12 :: Context -> HandshakeR -> IO ()
#
valueupdateTranscriptHash13 :: Context -> Handshake13R -> IO ()
#
valuedecodeReallyServerKeyXchgAlgorithmData
  1. :: Version
  2. -> CipherKeyExchangeType
  3. -> ByteString
  4. -> Either TLSError ServerKeyXchgAlgorithmData
#

in certain cases, we haven't manage to decode ServerKeyExchange properly, because the decoding was too eager and the cipher wasn't been set yet. we keep the Server Key Exchange in it unparsed format, and this function is able to really decode the server key xchange if it's unparsed.

valuegetHandshakeType :: Get HandshakeType
#
valuegetPRF :: Version -> Cipher -> PRF
#

The TLS12 PRF is cipher specific, and some TLS12 algorithms use SHA384 instead of the default SHA256.

valuegetSession :: Get Session
#
valueputSession :: Session -> Put
#
datadata CurrentParams
#

Constructors

  • CurrentParams
    • cParamsVersion :: Version

      current protocol version

    • cParamsKeyXchgType :: Maybe CipherKeyExchangeType

      current key exchange type

Instances2Eq, Show
  • Eq CurrentParamsDefined in tls-2.4.9 · Network.TLS.Packet
  • Show CurrentParamsDefined in tls-2.4.9 · Network.TLS.Packet
valueemptyCertificateChain_ :: CertificateChain_
#
valuelastSupportedCertificateType :: CertificateType
#

Last supported certificate type, no 'CertificateType that compares greater than this one (based on the Ord instance, not on the wire code point) will be reported to the application via the client certificate request callback.

valueserverDHParamsToParams :: ServerDHParams -> DHParams
#
valueserverDHParamsToPublic :: ServerDHParams -> DHPublic
#
valuetypeOfHandshake :: Handshake -> HandshakeType
#
newtypenewtype DistinguishedName
#

A list of OID and strings.

Instances6Eq, Ord, Show, Semigroup, Monoid, ASN1Object
newtypenewtype AlertLevel
#

Constructors

  • AlertLevel
Instances2Eq, Show
  • Eq AlertLevelDefined in tls-2.4.9 · Network.TLS.Error
  • Show AlertLevelDefined in tls-2.4.9 · Network.TLS.Error
patternpattern AlertLevel_Fatal :: AlertLevel
#
patternpattern AlertLevel_Warning :: AlertLevel
#
datadata TLSError
#

TLSError that might be returned through the TLS stack.

Prior to version 1.8.0, this type had an Exception instance. In version 1.8.0, this instance was removed, and functions in this library now only throw TLSException.

Constructors

Instances4Eq, Show, MonadError
datadata TLSException
#

TLS Exceptions. Some of the data constructors indicate incorrect use of the library, and the documentation for those data constructors calls this out. The others wrap TLSError with some kind of context to explain when the exception occurred.

Constructors

Instances3Eq, Show, Exception
newtypenewtype CertificateChain_
#

Constructors

Instances2Eq, Show
  • Eq CertificateChain_Defined in tls-2.4.9 · Network.TLS.Struct
  • Show CertificateChain_Defined in tls-2.4.9 · Network.TLS.Struct
newtypenewtype CertificateType
#

Some of the IANA registered code points for CertificateType are not currently supported by the library. Nor should they be, they're are either unwise, obsolete or both. There's no point in conveying these to the user in the client certificate request callback. The request callback will be filtered to exclude unsupported values. If the user cannot find a certificate for a supported code point, we'll go ahead without a client certificate and hope for the best, unless the user's callback decides to throw an exception.

Instances3Eq, Ord, Show
datadata CipherData
#

Constructors

Instances2Eq, Show
  • Eq CipherDataDefined in tls-2.4.9 · Network.TLS.Struct
  • Show CipherDataDefined in tls-2.4.9 · Network.TLS.Struct
datadata ClientHello
#

Constructors

Instances2Eq, Show
  • Eq ClientHelloDefined in tls-2.4.9 · Network.TLS.Struct
  • Show ClientHelloDefined in tls-2.4.9 · Network.TLS.Struct
datadata ClientKeyXchgAlgorithmData
#

Constructors

Instances2Eq, Show
  • Eq ClientKeyXchgAlgorithmDataDefined in tls-2.4.9 · Network.TLS.Struct
  • Show ClientKeyXchgAlgorithmDataDefined in tls-2.4.9 · Network.TLS.Struct
datadata DigitallySigned
#

Constructors

Instances2Eq, Show
  • Eq DigitallySignedDefined in tls-2.4.9 · Network.TLS.Struct
  • Show DigitallySignedDefined in tls-2.4.9 · Network.TLS.Struct
typetype FinishedData = ByteString
#

Deprecated. use VerifyData

datadata Handshake
#

Constructors

  • ClientHello ClientHello
  • ServerHello ServerHello
  • Certificate CertificateChain_
  • HelloRequest
  • ServerHelloDone
  • ClientKeyXchg ClientKeyXchgAlgorithmData
  • ServerKeyXchg ServerKeyXchgAlgorithmData
  • CertRequest [CertificateType] [HashAndSignatureAlgorithm] [DistinguishedName]
  • CertVerify DigitallySigned
  • Finished VerifyData
  • NewSessionTicket Second Ticket
Instances2Eq, Show
typetype HandshakeR = (Handshake, WireBytes)
#
newtypenewtype HandshakeType
#

Constructors

  • HandshakeType
    • fromHandshakeType :: Word8
Instances2Eq, Show
  • Eq HandshakeTypeDefined in tls-2.4.9 · Network.TLS.Struct
  • Show HandshakeTypeDefined in tls-2.4.9 · Network.TLS.Struct
patternpattern HandshakeType_CertRequest :: HandshakeType
#
patternpattern HandshakeType_CertVerify :: HandshakeType
#
patternpattern HandshakeType_Certificate :: HandshakeType
#
patternpattern HandshakeType_ClientHello :: HandshakeType
#
patternpattern HandshakeType_ClientKeyXchg :: HandshakeType
#
patternpattern HandshakeType_CompressedCertificate :: HandshakeType
#
patternpattern HandshakeType_EncryptedExtensions :: HandshakeType
#
patternpattern HandshakeType_EndOfEarlyData :: HandshakeType
#
patternpattern HandshakeType_Finished :: HandshakeType
#
patternpattern HandshakeType_HelloRequest :: HandshakeType
#
patternpattern HandshakeType_KeyUpdate :: HandshakeType
#
patternpattern HandshakeType_NewSessionTicket :: HandshakeType
#
patternpattern HandshakeType_ServerHello :: HandshakeType
#
patternpattern HandshakeType_ServerHelloDone :: HandshakeType
#
patternpattern HandshakeType_ServerKeyXchg :: HandshakeType
#
datadata Packet
#

Constructors

Instances2Eq, Show
  • Eq PacketDefined in tls-2.4.9 · Network.TLS.Struct
  • Show PacketDefined in tls-2.4.9 · Network.TLS.Struct
datadata ServerDHParams
#

Constructors

  • ServerDHParams
    • serverDHParams_p :: BigNum
    • serverDHParams_g :: BigNum
    • serverDHParams_y :: BigNum
Instances2Eq, Show
  • Eq ServerDHParamsDefined in tls-2.4.9 · Network.TLS.Struct
  • Show ServerDHParamsDefined in tls-2.4.9 · Network.TLS.Struct
datadata ServerECDHParams
#

Constructors

  • ServerECDHParams Group GroupPublicA
Instances2Eq, Show
  • Eq ServerECDHParamsDefined in tls-2.4.9 · Network.TLS.Struct
  • Show ServerECDHParamsDefined in tls-2.4.9 · Network.TLS.Struct
datadata ServerHello
#

Constructors

Instances2Eq, Show
  • Eq ServerHelloDefined in tls-2.4.9 · Network.TLS.Struct
  • Show ServerHelloDefined in tls-2.4.9 · Network.TLS.Struct
datadata ServerKeyXchgAlgorithmData
#

Constructors

  • SKX_DH_Anon ServerDHParams
  • SKX_DHE_DSA ServerDHParams DigitallySigned
  • SKX_DHE_RSA ServerDHParams DigitallySigned
  • SKX_ECDHE_RSA ServerECDHParams DigitallySigned
  • SKX_ECDHE_ECDSA ServerECDHParams DigitallySigned
  • SKX_RSA (Maybe ServerRSAParams)
  • SKX_DH_DSA (Maybe ServerDSAParams)
  • SKX_DH_RSA (Maybe ServerRSAParams)
  • SKX_Unparsed ByteString
  • SKX_Unknown ByteString
Instances2Eq, Show
  • Eq ServerKeyXchgAlgorithmDataDefined in tls-2.4.9 · Network.TLS.Struct
  • Show ServerKeyXchgAlgorithmDataDefined in tls-2.4.9 · Network.TLS.Struct
datadata ServerRSAParams
#

Constructors

Instances2Eq, Show
  • Eq ServerRSAParamsDefined in tls-2.4.9 · Network.TLS.Struct
  • Show ServerRSAParamsDefined in tls-2.4.9 · Network.TLS.Struct
newtypenewtype Session
#

Constructors

Instances2Eq, Show
  • Eq SessionDefined in tls-2.4.9 · Network.TLS.Struct
  • Show SessionDefined in tls-2.4.9 · Network.TLS.Struct
newtypenewtype VerifyData
#

Constructors

Instances2Eq, Show
  • Eq VerifyDataDefined in tls-2.4.9 · Network.TLS.Struct
  • Show VerifyDataDefined in tls-2.4.9 · Network.TLS.Struct
datadata SessionData
#
Instances6Eq, Show, Generic, DebugShow, Serialise, Rep
newtypenewtype Version
#

Versions known to TLS

Constructors

Instances6Eq, Ord, Show, Generic, Serialise, Rep
valuetypeOfHandshake13 :: Handshake13 -> HandshakeType
#
typetype CertReqContext = ByteString
#

Certificate request context for TLS 1.3.

datadata Handshake13
#

Constructors

  • ServerHello13 ServerHello
  • NewSessionTicket13 Second Word32 TicketNonce SessionIDorTicket_ [ExtensionRaw]
  • EndOfEarlyData13
  • EncryptedExtensions13 [ExtensionRaw]
  • Certificate13 CertReqContext CertificateChain_ [[ExtensionRaw]]
  • CertRequest13 CertReqContext [ExtensionRaw]
  • CertVerify13 DigitallySigned
  • Finished13 VerifyData
  • KeyUpdate13 KeyUpdate
  • CompressedCertificate13 CertReqContext CertificateChain_ [[ExtensionRaw]]
Instances2Eq, Show
datadata Packet13
#

Constructors

Instances2Eq, Show
  • Eq Packet13Defined in tls-2.4.9 · Network.TLS.Struct13
  • Show Packet13Defined in tls-2.4.9 · Network.TLS.Struct13
newtypenewtype SessionIDorTicket_
#

Constructors

Instances2Eq, Show
  • Eq SessionIDorTicket_Defined in tls-2.4.9 · Network.TLS.Struct13
  • Show SessionIDorTicket_Defined in tls-2.4.9 · Network.TLS.Struct13
newtypenewtype TicketNonce
#

Constructors

Instances2Eq, Show
  • Eq TicketNonceDefined in tls-2.4.9 · Network.TLS.Struct13
  • Show TicketNonceDefined in tls-2.4.9 · Network.TLS.Struct13
valuebigNumFromInteger :: Integer -> BigNum
#
valuebigNumToInteger :: BigNum -> Integer
#
valuedefaultRecordSizeLimit :: Int
#
valueinvertRole :: Role -> Role
#
valuemaxHandshakeSize :: Int
#

The largest handshake message we will reassemble.

A handshake message carries a 24-bit length, so a peer may announce close to 16MB and then feed it a record at a time. Records are bounded, but the message they are reassembled into was not, and the fragments are held until it is complete -- before anything has authenticated the peer.

The largest legitimate one is a Certificate message. A long chain of post-quantum certificates runs to tens of kilobytes, so this leaves an order of magnitude over anything real while taking two orders of magnitude off what a peer can ask us to hold.

valueglobalCipherDict :: IORef [Cipher]
#
valueshowsSessionData :: ShowS -> Int -> SessionData -> ShowS
#

What the two instances above share, so that a field added to SessionData cannot reach one of them and not the other.

typetype HostName = String
#

Either a host name e.g., "haskell.org" or a numeric host address string consisting of a dotted decimal IPv4 address or an IPv6 address e.g., "192.168.0.1".

newtypenewtype BigNum
#

Constructors

Instances2Eq, Show
  • Eq BigNumDefined in tls-2.4.9 · Network.TLS.Types
  • Show BigNumDefined in tls-2.4.9 · Network.TLS.Types
datadata Direction
#

Direction

Instances2Eq, Show
  • Eq DirectionDefined in tls-2.4.9 · Network.TLS.Types
  • Show DirectionDefined in tls-2.4.9 · Network.TLS.Types
datadata Role
#
Instances2Eq, Show
  • Eq RoleDefined in tls-2.4.9 · Network.TLS.Types
  • Show RoleDefined in tls-2.4.9 · Network.TLS.Types
newtypenewtype TranscriptHash
#

Constructors

Instances1Show
  • Show TranscriptHashDefined in tls-2.4.9 · Network.TLS.Types
datadata Bulk
#

Constructors

  • Bulk
    • bulkName :: String
    • bulkKeySize :: Int
    • bulkIVSize :: Int
    • bulkExplicitIV :: Int
    • bulkAuthTagLen :: Int
    • bulkBlockSize :: Int
    • bulkF :: BulkFunctions
Instances2Eq, Show
  • Eq BulkDefined in tls-2.4.9 · Network.TLS.Types.Cipher
  • Show BulkDefined in tls-2.4.9 · Network.TLS.Types.Cipher
datadata BulkDirection
#
Instances2Eq, Show
  • Eq BulkDirectionDefined in tls-2.4.9 · Network.TLS.Types.Cipher
  • Show BulkDirectionDefined in tls-2.4.9 · Network.TLS.Types.Cipher
datadata BulkFunctions
#

Constructors

  • BulkBlockF (BulkDirection -> BulkKey -> BulkBlock)
  • BulkStreamF (BulkDirection -> BulkKey -> BulkStream)
  • BulkAeadF (BulkDirection -> BulkKey -> BulkAEAD)
typetype BulkIV = Nonce
#
typetype BulkKey = Secret
#
typetype BulkNonce = Nonce
#
datadata Cipher
#

Cipher algorithm

Constructors

  • Cipher
    • cipherID :: CipherID
    • cipherName :: String
    • cipherHash :: Hash
    • cipherBulk :: Bulk
    • cipherKeyExchange :: CipherKeyExchangeType
    • cipherMinVer :: Maybe Version
    • cipherPRFHash :: Maybe Hash
Instances2Eq, Show
  • Eq CipherDefined in tls-2.4.9 · Network.TLS.Types.Cipher
  • Show CipherDefined in tls-2.4.9 · Network.TLS.Types.Cipher
typetype CipherID = Word16
#

Cipher identification

newtypenewtype CipherId
#

Constructors

  • CipherId
Instances10Enum, Eq, Integral, Num, Ord, Read, …
  • Enum CipherIdDefined in tls-2.4.9 · Network.TLS.Types.Cipher
  • Eq CipherIdDefined in tls-2.4.9 · Network.TLS.Types.Cipher
  • Integral CipherIdDefined in tls-2.4.9 · Network.TLS.Types.Cipher
  • Num CipherIdDefined in tls-2.4.9 · Network.TLS.Types.Cipher
  • Ord CipherIdDefined in tls-2.4.9 · Network.TLS.Types.Cipher
  • Read CipherIdDefined in tls-2.4.9 · Network.TLS.Types.Cipher
  • Real CipherIdDefined in tls-2.4.9 · Network.TLS.Types.Cipher
  • Show CipherIdDefined in tls-2.4.9 · Network.TLS.Types.Cipher
  • Generic CipherIdDefined in tls-2.4.9 · Network.TLS.Types.Cipher
  • type Rep CipherId = D1 ('MetaData "CipherId" "Network.TLS.Types.Cipher" "tls-2.4.9-ByAGBT1JYRq7CxE2OAvacr" 'True) (C1 ('MetaCons "CipherId" 'PrefixI 'True) (S1 ('MetaSel ('Just "fromCipherId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word16)))Defined in tls-2.4.9 · Network.TLS.Types.Cipher
newtypenewtype AnyTrafficSecret a
#

Constructors

  • AnyTrafficSecret Secret
Instances3Show, DebugShow, TrafficSecret
  • Show (AnyTrafficSecret a)Defined in tls-2.4.9 · Network.TLS.Types.Secret
  • DebugShow (AnyTrafficSecret a)Defined in tls-2.4.9 · Network.TLS.Types.Secret
  • HasCryptLevel a => TrafficSecret (AnyTrafficSecret a)Defined in tls-2.4.9 · Network.TLS.Handshake.State13
newtypenewtype BaseSecret a
#

Constructors

  • BaseSecret Secret
Instances2Show, DebugShow
  • Show (BaseSecret a)Defined in tls-2.4.9 · Network.TLS.Types.Secret
  • DebugShow (BaseSecret a)Defined in tls-2.4.9 · Network.TLS.Types.Secret
newtypenewtype ClientTrafficSecret a
#

A client traffic secret, typed with a parameter indicating a step in the TLS key schedule.

Constructors

Instances6Show, DebugShow, LogLabel, TrafficSecret
datadata EarlySecret
#

Phantom type indicating early traffic secret.

Instances2HasCryptLevel, LogLabel
newtypenewtype MainSecret
#

Constructors

  • MainSecret Secret
Instances3Show, DebugShow, LogLabel
  • Show MainSecretDefined in tls-2.4.9 · Network.TLS.Types.Secret
  • DebugShow MainSecretDefined in tls-2.4.9 · Network.TLS.Types.Secret
  • LogLabel MainSecretDefined in tls-2.4.9 · Network.TLS.Handshake.Key
datadata ResumptionSecret
#
datadata SecretPair a
#

Constructors

Instances1Show
  • Show (SecretPair a)Defined in tls-2.4.9 · Network.TLS.Types.Secret
datadata SecretTriple a
#

Constructors

Instances1Show
  • Show (SecretTriple a)Defined in tls-2.4.9 · Network.TLS.Types.Secret
newtypenewtype ServerTrafficSecret a
#

A server traffic secret, typed with a parameter indicating a step in the TLS key schedule.

Constructors

Instances5Show, DebugShow, LogLabel, TrafficSecret
typetype Millisecond = Word64
#
datadata SessionData
#
Instances6Eq, Show, Generic, DebugShow, Serialise, Rep
datadata SessionFlag
#

Some session flags

Constructors

  • SessionEMS

    Session created with Extended Main Secret

Instances6Enum, Eq, Show, Generic, Serialise, Rep
datadata TLS13TicketInfo
#

Constructors

  • TLS13TicketInfo
    • lifetime :: Second
    • ageAdd :: Second
    • txrxTime :: Millisecond
    • estimatedRTT :: Maybe Millisecond
Instances5Eq, Show, Generic, Serialise, Rep
newtypenewtype Version
#

Versions known to TLS

Constructors

Instances6Eq, Ord, Show, Generic, Serialise, Rep
valueisEmpty :: Get Bool
#

Test whether all input has been consumed.

WARNING: when run with runGetPartial, isEmpty will only tell you if you're at the end of the current chunk.

valueremaining :: Get Int
#

Get the number of remaining unparsed bytes. Useful for checking whether all input has been consumed.

WARNING: when run with runGetPartial, remaining will only return the number of bytes that are remaining in the current input.

valuegetBigNum16 :: Get BigNum
#
valueputBigNum16 :: BigNum -> Put
#
newtypenewtype Get a
#

The Get monad is an Exception and State monad.

Instances6Monad, Functor, MonadFail, Applicative, Alternative, MonadPlus
  • Monad GetDefined in cereal-0.5.8.3 · Data.Serialize.Get
  • Functor GetDefined in cereal-0.5.8.3 · Data.Serialize.Get
  • MonadFail GetDefined in cereal-0.5.8.3 · Data.Serialize.Get
  • Applicative GetDefined in cereal-0.5.8.3 · Data.Serialize.Get
  • Alternative GetDefined in cereal-0.5.8.3 · Data.Serialize.Get
  • MonadPlus GetDefined in cereal-0.5.8.3 · Data.Serialize.Get
typetype Put = PutM ()
#

Put merely lifts Builder into a Writer monad, applied to ().

typetype GetContinuation a = ByteString -> GetResult a
#
datadata GetResult a
#

Constructors

  • GotError TLSError
  • GotPartial (GetContinuation a)
  • GotSuccess a
  • GotSuccessRemaining a ByteString

create a simple constant cache that list exceptions to the certification validation. Typically this is use to allow self-signed certificates for specific use, with out-of-bounds user checks.

No fingerprints will be added after the instance is created.

The underlying structure for the check is kept as a list, as usually the exception list will be short, but when the list go above a dozen exceptions it's recommended to use another cache mechanism with a faster lookup mechanism (hashtable, map, etc).

Note that only one fingerprint is allowed per ServiceID, for other use, another cache mechanism need to be use.

datadata ValidationCache
#

All the callbacks needed for querying and adding to the cache.

Instances1Default
typetype ServiceID = (HostName, ByteString)
#

identification of the connection consisting of the fully qualified host name (e.g. www.example.com) and an optional suffix.

The suffix is not used by the validation process, but is used by the optional cache to identity certificate per service on a specific host. For example, one might have a different certificate on 2 differents ports (443 and 995) for the same host.

for TCP connection, it's recommended to use: :port, or :service for the suffix.

valuesendPacket12 :: Context -> Packet -> IO ()
#

Send one packet to the context

valuerecvPacket12 :: Context -> IO (Either TLSError Packet)
#

receive one packet from the context that contains 1 or many messages (many only in case of handshake). if will returns a TLSError if the packet is unexpected or malformed

valuemakeCipherShowPretty :: IO ()
#