rustls-0.1.0.0: TLS bindings for Rustls
Safe HaskellSafe-Inferred
LanguageGHC2021

Rustls.Internal

Description

Internal module, not subject to PVP.

Synopsis

Documentation

newtype ALPNProtocol Source #

Constructors

ALPNProtocol 

Instances

Instances details
Generic ALPNProtocol Source # 
Instance details

Defined in Rustls.Internal

Associated Types

type Rep ALPNProtocol :: Type -> Type #

Show ALPNProtocol Source # 
Instance details

Defined in Rustls.Internal

Eq ALPNProtocol Source # 
Instance details

Defined in Rustls.Internal

Ord ALPNProtocol Source # 
Instance details

Defined in Rustls.Internal

type Rep ALPNProtocol Source # 
Instance details

Defined in Rustls.Internal

type Rep ALPNProtocol = D1 ('MetaData "ALPNProtocol" "Rustls.Internal" "rustls-0.1.0.0-inplace" 'True) (C1 ('MetaCons "ALPNProtocol" 'PrefixI 'True) (S1 ('MetaSel ('Just "unALPNProtocol") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ByteString)))

newtype CipherSuite Source #

A TLS cipher suite supported by Rustls.

cipherSuiteID :: CipherSuite -> Word16 Source #

Get the IANA value from a cipher suite. The bytes are interpreted in network order.

See https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#tls-parameters-4 for a list.

showCipherSuite :: CipherSuite -> Text Source #

Get the text representation of a cipher suite.

data ClientConfigBuilder Source #

Rustls client config builder.

Constructors

ClientConfigBuilder 

Fields

Instances

Instances details
Generic ClientConfigBuilder Source # 
Instance details

Defined in Rustls.Internal

Associated Types

type Rep ClientConfigBuilder :: Type -> Type #

Show ClientConfigBuilder Source # 
Instance details

Defined in Rustls.Internal

type Rep ClientConfigBuilder Source # 
Instance details

Defined in Rustls.Internal

type Rep ClientConfigBuilder = D1 ('MetaData "ClientConfigBuilder" "Rustls.Internal" "rustls-0.1.0.0-inplace" 'False) (C1 ('MetaCons "ClientConfigBuilder" 'PrefixI 'True) ((S1 ('MetaSel ('Just "clientConfigServerCertVerifier") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ServerCertVerifier) :*: (S1 ('MetaSel ('Just "clientConfigTLSVersions") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [TLSVersion]) :*: S1 ('MetaSel ('Just "clientConfigCipherSuites") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [CipherSuite]))) :*: (S1 ('MetaSel ('Just "clientConfigALPNProtocols") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [ALPNProtocol]) :*: (S1 ('MetaSel ('Just "clientConfigEnableSNI") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Bool) :*: S1 ('MetaSel ('Just "clientConfigCertifiedKeys") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [CertifiedKey])))))

data ServerCertVerifier Source #

How to verify TLS server certificates.

Constructors

ServerCertVerifier 

Fields

Instances

Instances details
Generic ServerCertVerifier Source # 
Instance details

Defined in Rustls.Internal

Associated Types

type Rep ServerCertVerifier :: Type -> Type #

Show ServerCertVerifier Source # 
Instance details

Defined in Rustls.Internal

type Rep ServerCertVerifier Source # 
Instance details

Defined in Rustls.Internal

type Rep ServerCertVerifier = D1 ('MetaData "ServerCertVerifier" "Rustls.Internal" "rustls-0.1.0.0-inplace" 'False) (C1 ('MetaCons "ServerCertVerifier" 'PrefixI 'True) (S1 ('MetaSel ('Just "serverCertVerifierCertificates") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (NonEmpty PEMCertificates)) :*: S1 ('MetaSel ('Just "serverCertVerifierCRLs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [CertificateRevocationList])))

data PEMCertificates Source #

A source of PEM-encoded certificates.

Constructors

PEMCertificatesInMemory ByteString PEMCertificateParsing

In-memory PEM-encoded certificates.

PemCertificatesFromFile FilePath PEMCertificateParsing

Fetch PEM-encoded root certificates from a file.

data PEMCertificateParsing Source #

Parsing mode for PEM-encoded certificates.

Constructors

PEMCertificateParsingStrict

Fail if syntactically invalid.

PEMCertificateParsingLax

Ignore if syntactically invalid.

This may be useful on systems that have syntactically invalid root certificates.

Instances

Instances details
Bounded PEMCertificateParsing Source # 
Instance details

Defined in Rustls.Internal

Enum PEMCertificateParsing Source # 
Instance details

Defined in Rustls.Internal

Generic PEMCertificateParsing Source # 
Instance details

Defined in Rustls.Internal

Associated Types

type Rep PEMCertificateParsing :: Type -> Type #

Show PEMCertificateParsing Source # 
Instance details

Defined in Rustls.Internal

Eq PEMCertificateParsing Source # 
Instance details

Defined in Rustls.Internal

Ord PEMCertificateParsing Source # 
Instance details

Defined in Rustls.Internal

type Rep PEMCertificateParsing Source # 
Instance details

Defined in Rustls.Internal

type Rep PEMCertificateParsing = D1 ('MetaData "PEMCertificateParsing" "Rustls.Internal" "rustls-0.1.0.0-inplace" 'False) (C1 ('MetaCons "PEMCertificateParsingStrict" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "PEMCertificateParsingLax" 'PrefixI 'False) (U1 :: Type -> Type))

data CertifiedKey Source #

A complete chain of certificates plus a private key for the leaf certificate.

Constructors

CertifiedKey 

Fields

Instances

Instances details
Generic CertifiedKey Source # 
Instance details

Defined in Rustls.Internal

Associated Types

type Rep CertifiedKey :: Type -> Type #

Show CertifiedKey Source # 
Instance details

Defined in Rustls.Internal

type Rep CertifiedKey Source # 
Instance details

Defined in Rustls.Internal

type Rep CertifiedKey = D1 ('MetaData "CertifiedKey" "Rustls.Internal" "rustls-0.1.0.0-inplace" 'False) (C1 ('MetaCons "CertifiedKey" 'PrefixI 'True) (S1 ('MetaSel ('Just "certificateChain") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ByteString) :*: S1 ('MetaSel ('Just "privateKey") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ByteString)))

data ClientConfig Source #

Assembled configuration for a Rustls client connection.

Constructors

ClientConfig 

Fields

data ClientCertVerifier Source #

How to verify TLS client certificates.

Constructors

ClientCertVerifier 

Fields

Instances

Instances details
Generic ClientCertVerifier Source # 
Instance details

Defined in Rustls.Internal

Associated Types

type Rep ClientCertVerifier :: Type -> Type #

Show ClientCertVerifier Source # 
Instance details

Defined in Rustls.Internal

type Rep ClientCertVerifier Source # 
Instance details

Defined in Rustls.Internal

type Rep ClientCertVerifier = D1 ('MetaData "ClientCertVerifier" "Rustls.Internal" "rustls-0.1.0.0-inplace" 'False) (C1 ('MetaCons "ClientCertVerifier" 'PrefixI 'True) (S1 ('MetaSel ('Just "clientCertVerifierPolicy") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ClientCertVerifierPolicy) :*: (S1 ('MetaSel ('Just "clientCertVerifierCertificates") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (NonEmpty PEMCertificates)) :*: S1 ('MetaSel ('Just "clientCertVerifierCRLs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [CertificateRevocationList]))))

data ClientCertVerifierPolicy Source #

Which client connections are allowed by a ClientCertVerifier.

Constructors

AllowAnyAuthenticatedClient

Allow any authenticated client (i.e. offering a trusted certificate), and reject clients offering none.

AllowAnyAnonymousOrAuthenticatedClient

Allow any authenticated client (i.e. offering a trusted certificate), but also allow clients offering none.

Instances

Instances details
Bounded ClientCertVerifierPolicy Source # 
Instance details

Defined in Rustls.Internal

Enum ClientCertVerifierPolicy Source # 
Instance details

Defined in Rustls.Internal

Generic ClientCertVerifierPolicy Source # 
Instance details

Defined in Rustls.Internal

Associated Types

type Rep ClientCertVerifierPolicy :: Type -> Type #

Show ClientCertVerifierPolicy Source # 
Instance details

Defined in Rustls.Internal

Eq ClientCertVerifierPolicy Source # 
Instance details

Defined in Rustls.Internal

Ord ClientCertVerifierPolicy Source # 
Instance details

Defined in Rustls.Internal

type Rep ClientCertVerifierPolicy Source # 
Instance details

Defined in Rustls.Internal

type Rep ClientCertVerifierPolicy = D1 ('MetaData "ClientCertVerifierPolicy" "Rustls.Internal" "rustls-0.1.0.0-inplace" 'False) (C1 ('MetaCons "AllowAnyAuthenticatedClient" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "AllowAnyAnonymousOrAuthenticatedClient" 'PrefixI 'False) (U1 :: Type -> Type))

newtype CertificateRevocationList Source #

One or more PEM-encoded certificate revocation lists (CRL).

Instances

Instances details
Generic CertificateRevocationList Source # 
Instance details

Defined in Rustls.Internal

Associated Types

type Rep CertificateRevocationList :: Type -> Type #

Show CertificateRevocationList Source # 
Instance details

Defined in Rustls.Internal

type Rep CertificateRevocationList Source # 
Instance details

Defined in Rustls.Internal

type Rep CertificateRevocationList = D1 ('MetaData "CertificateRevocationList" "Rustls.Internal" "rustls-0.1.0.0-inplace" 'True) (C1 ('MetaCons "CertificateRevocationList" 'PrefixI 'True) (S1 ('MetaSel ('Just "unCertificateRevocationList") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ByteString)))

data ServerConfigBuilder Source #

Rustls client config builder.

Constructors

ServerConfigBuilder 

Fields

Instances

Instances details
Generic ServerConfigBuilder Source # 
Instance details

Defined in Rustls.Internal

Associated Types

type Rep ServerConfigBuilder :: Type -> Type #

Show ServerConfigBuilder Source # 
Instance details

Defined in Rustls.Internal

type Rep ServerConfigBuilder Source # 
Instance details

Defined in Rustls.Internal

type Rep ServerConfigBuilder = D1 ('MetaData "ServerConfigBuilder" "Rustls.Internal" "rustls-0.1.0.0-inplace" 'False) (C1 ('MetaCons "ServerConfigBuilder" 'PrefixI 'True) ((S1 ('MetaSel ('Just "serverConfigCertifiedKeys") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (NonEmpty CertifiedKey)) :*: (S1 ('MetaSel ('Just "serverConfigTLSVersions") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [TLSVersion]) :*: S1 ('MetaSel ('Just "serverConfigCipherSuites") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [CipherSuite]))) :*: (S1 ('MetaSel ('Just "serverConfigALPNProtocols") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [ALPNProtocol]) :*: (S1 ('MetaSel ('Just "serverConfigIgnoreClientOrder") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Bool) :*: S1 ('MetaSel ('Just "serverConfigClientCertVerifier") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe ClientCertVerifier))))))

data ServerConfig Source #

Assembled configuration for a Rustls server connection.

Constructors

ServerConfig 

Fields

data LogLevel Source #

Rustls log level.

Instances

Instances details
Bounded LogLevel Source # 
Instance details

Defined in Rustls.Internal

Enum LogLevel Source # 
Instance details

Defined in Rustls.Internal

Generic LogLevel Source # 
Instance details

Defined in Rustls.Internal

Associated Types

type Rep LogLevel :: Type -> Type #

Methods

from :: LogLevel -> Rep LogLevel x #

to :: Rep LogLevel x -> LogLevel #

Show LogLevel Source # 
Instance details

Defined in Rustls.Internal

Eq LogLevel Source # 
Instance details

Defined in Rustls.Internal

Ord LogLevel Source # 
Instance details

Defined in Rustls.Internal

type Rep LogLevel Source # 
Instance details

Defined in Rustls.Internal

type Rep LogLevel = D1 ('MetaData "LogLevel" "Rustls.Internal" "rustls-0.1.0.0-inplace" 'False) ((C1 ('MetaCons "LogLevelError" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "LogLevelWarn" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "LogLevelInfo" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "LogLevelDebug" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "LogLevelTrace" 'PrefixI 'False) (U1 :: Type -> Type))))

newtype LogCallback Source #

A Rustls connection logging callback.

newtype HandshakeQuery (side :: Side) a Source #

A Monad to get TLS connection information via handshake.

Instances

Instances details
Applicative (HandshakeQuery side) Source # 
Instance details

Defined in Rustls.Internal

Methods

pure :: a -> HandshakeQuery side a #

(<*>) :: HandshakeQuery side (a -> b) -> HandshakeQuery side a -> HandshakeQuery side b #

liftA2 :: (a -> b -> c) -> HandshakeQuery side a -> HandshakeQuery side b -> HandshakeQuery side c #

(*>) :: HandshakeQuery side a -> HandshakeQuery side b -> HandshakeQuery side b #

(<*) :: HandshakeQuery side a -> HandshakeQuery side b -> HandshakeQuery side a #

Functor (HandshakeQuery side) Source # 
Instance details

Defined in Rustls.Internal

Methods

fmap :: (a -> b) -> HandshakeQuery side a -> HandshakeQuery side b #

(<$) :: a -> HandshakeQuery side b -> HandshakeQuery side a #

Monad (HandshakeQuery side) Source # 
Instance details

Defined in Rustls.Internal

Methods

(>>=) :: HandshakeQuery side a -> (a -> HandshakeQuery side b) -> HandshakeQuery side b #

(>>) :: HandshakeQuery side a -> HandshakeQuery side b -> HandshakeQuery side b #

return :: a -> HandshakeQuery side a #

newtype RustlsException Source #

TLS exception thrown by Rustls.

Use displayException for a human-friendly representation.

Constructors

RustlsException 

isCertError :: RustlsException -> Bool Source #

Checks if the given RustlsException represents a certificate error.

data Backend Source #

Underlying data source for Rustls.

Constructors

Backend 

Fields

mkByteStringBackend Source #

Arguments

:: (Int -> IO ByteString)

Read a ByteString with the given max length.

This will silently truncate ByteStrings which are too long.

-> (ByteString -> IO ())

Write a ByteString.

-> Backend 

An in-memory Backend.

data Side Source #

Type-level indicator whether a Connection is client- or server-side.

Constructors

Client 
Server 

newtype Connection (side :: Side) Source #

A Rustls connection.

Constructors

Connection (MVar Connection') 

data ReadOrWrite Source #

Constructors

Read 
Write 

data IOMsgReq Source #

Messages sent to the background thread.

Constructors

Request ReadOrWrite

Request to start a read or a write FFI call from the background thread. It should respond with UsingBuffer.

Done IOResult

Notify the background thread that we are done interacting with the buffer.

data IOMsgRes Source #

Messages sent from the background thread.

Constructors

UsingBuffer (Ptr Word8) CSize (Ptr CSize)

Reply with a buffer, either containing the read data, or awaiting a write to this buffer.

DoneFFI

Notify that the FFI call finished.

data IsEOF Source #

Constructors

IsEOF 
NotEOF 

Instances

Instances details
Show IsEOF Source # 
Instance details

Defined in Rustls.Internal

Methods

showsPrec :: Int -> IsEOF -> ShowS #

show :: IsEOF -> String #

showList :: [IsEOF] -> ShowS #

Eq IsEOF Source # 
Instance details

Defined in Rustls.Internal

Methods

(==) :: IsEOF -> IsEOF -> Bool #

(/=) :: IsEOF -> IsEOF -> Bool #

whenM :: Monad m => m Bool -> m () -> m () Source #

loopWhileTrue :: Monad m => m Bool -> m () Source #