Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Internal module, not subject to PVP.
Synopsis
- newtype ALPNProtocol = ALPNProtocol {}
- newtype CipherSuite = CipherSuite (ConstPtr SupportedCipherSuite)
- cipherSuiteID :: CipherSuite -> Word16
- showCipherSuite :: CipherSuite -> Text
- data ClientConfigBuilder = ClientConfigBuilder {}
- data ServerCertVerifier = ServerCertVerifier {}
- data PEMCertificates
- data PEMCertificateParsing
- data CertifiedKey = CertifiedKey {}
- data ClientConfig = ClientConfig {}
- data ClientCertVerifier = ClientCertVerifier {}
- data ClientCertVerifierPolicy
- newtype CertificateRevocationList = CertificateRevocationList {}
- data ServerConfigBuilder = ServerConfigBuilder {}
- data ServerConfig = ServerConfig {}
- data LogLevel
- newtype LogCallback = LogCallback {}
- newtype HandshakeQuery (side :: Side) a = HandshakeQuery (ReaderT Connection' IO a)
- handshakeQuery :: (Connection' -> IO a) -> HandshakeQuery side a
- newtype RustlsException = RustlsException {}
- resultMsg :: Result -> Text
- isCertError :: RustlsException -> Bool
- rethrowR :: Result -> IO ()
- newtype RustlsLogException = RustlsLogException SomeException
- data RustlsUnknownLogLevel = RustlsUnknownLogLevel LogLevel
- data Backend = Backend {}
- mkSocketBackend :: Socket -> Backend
- mkByteStringBackend :: (Int -> IO ByteString) -> (ByteString -> IO ()) -> Backend
- data Side
- newtype Connection (side :: Side) = Connection (MVar Connection')
- data Connection' = Connection' {}
- withConnection :: Connection side -> (Connection' -> IO a) -> IO a
- data ReadOrWrite
- data IOMsgReq
- data IOMsgRes
- interactTLS :: Connection' -> ReadOrWrite -> IO CSize
- data IsEOF
- completeIO :: Connection' -> IO IsEOF
- completePriorIO :: Connection' -> IO ()
- getIsHandshaking :: Connection' -> IO Bool
- getWantsRead :: Connection' -> IO Bool
- getWantsWrite :: Connection' -> IO Bool
- whenM :: Monad m => m Bool -> m () -> m ()
- loopWhileTrue :: Monad m => m Bool -> m ()
- cSizeToInt :: CSize -> Int
- intToCSize :: Int -> CSize
- strToText :: Str -> IO Text
- ignoreExceptions :: IO () -> IO ()
- ignoreSyncExceptions :: IO () -> IO ()
Documentation
newtype ALPNProtocol Source #
An ALPN protocol ID. See https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids for a list of registered IDs.
Instances
newtype CipherSuite Source #
A TLS cipher suite supported by Rustls.
Instances
Show CipherSuite Source # | |
Defined in Rustls.Internal showsPrec :: Int -> CipherSuite -> ShowS # show :: CipherSuite -> String # showList :: [CipherSuite] -> ShowS # | |
Eq CipherSuite Source # | |
Defined in Rustls.Internal (==) :: CipherSuite -> CipherSuite -> Bool # (/=) :: CipherSuite -> CipherSuite -> Bool # | |
Ord CipherSuite Source # | |
Defined in Rustls.Internal compare :: CipherSuite -> CipherSuite -> Ordering # (<) :: CipherSuite -> CipherSuite -> Bool # (<=) :: CipherSuite -> CipherSuite -> Bool # (>) :: CipherSuite -> CipherSuite -> Bool # (>=) :: CipherSuite -> CipherSuite -> Bool # max :: CipherSuite -> CipherSuite -> CipherSuite # min :: CipherSuite -> CipherSuite -> CipherSuite # |
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.
ClientConfigBuilder | |
|
Instances
data ServerCertVerifier Source #
How to verify TLS server certificates.
ServerCertVerifier | |
|
Instances
Generic ServerCertVerifier Source # | |
Defined in Rustls.Internal type Rep ServerCertVerifier :: Type -> Type # from :: ServerCertVerifier -> Rep ServerCertVerifier x # to :: Rep ServerCertVerifier x -> ServerCertVerifier # | |
Show ServerCertVerifier Source # | |
Defined in Rustls.Internal showsPrec :: Int -> ServerCertVerifier -> ShowS # show :: ServerCertVerifier -> String # showList :: [ServerCertVerifier] -> ShowS # | |
type Rep ServerCertVerifier Source # | |
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.
PEMCertificatesInMemory ByteString PEMCertificateParsing | In-memory PEM-encoded certificates. |
PemCertificatesFromFile FilePath PEMCertificateParsing | Fetch PEM-encoded root certificates from a file. |
Instances
data PEMCertificateParsing Source #
Parsing mode for PEM-encoded certificates.
PEMCertificateParsingStrict | Fail if syntactically invalid. |
PEMCertificateParsingLax | Ignore if syntactically invalid. This may be useful on systems that have syntactically invalid root certificates. |
Instances
data CertifiedKey Source #
A complete chain of certificates plus a private key for the leaf certificate.
CertifiedKey | |
|
Instances
Generic CertifiedKey Source # | |
Defined in Rustls.Internal type Rep CertifiedKey :: Type -> Type # from :: CertifiedKey -> Rep CertifiedKey x # to :: Rep CertifiedKey x -> CertifiedKey # | |
Show CertifiedKey Source # | |
Defined in Rustls.Internal showsPrec :: Int -> CertifiedKey -> ShowS # show :: CertifiedKey -> String # showList :: [CertifiedKey] -> ShowS # | |
type Rep CertifiedKey Source # | |
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.
ClientConfig | |
|
data ClientCertVerifier Source #
How to verify TLS client certificates.
ClientCertVerifier | |
|
Instances
data ClientCertVerifierPolicy Source #
Which client connections are allowed by a ClientCertVerifier
.
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
newtype CertificateRevocationList Source #
One or more PEM-encoded certificate revocation lists (CRL).
Instances
Generic CertificateRevocationList Source # | |
Defined in Rustls.Internal type Rep CertificateRevocationList :: Type -> Type # | |
Show CertificateRevocationList Source # | |
Defined in Rustls.Internal showsPrec :: Int -> CertificateRevocationList -> ShowS # show :: CertificateRevocationList -> String # showList :: [CertificateRevocationList] -> ShowS # | |
type Rep CertificateRevocationList Source # | |
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.
ServerConfigBuilder | |
|
Instances
data ServerConfig Source #
Assembled configuration for a Rustls server connection.
ServerConfig | |
|
Rustls log level.
Instances
Bounded LogLevel Source # | |
Enum LogLevel Source # | |
Generic LogLevel Source # | |
Show LogLevel Source # | |
Eq LogLevel Source # | |
Ord LogLevel Source # | |
Defined in Rustls.Internal | |
type Rep LogLevel Source # | |
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 #
Instances
Applicative (HandshakeQuery side) Source # | |
Defined in Rustls.Internal 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 # | |
Defined in Rustls.Internal fmap :: (a -> b) -> HandshakeQuery side a -> HandshakeQuery side b # (<$) :: a -> HandshakeQuery side b -> HandshakeQuery side a # | |
Monad (HandshakeQuery side) Source # | |
Defined in Rustls.Internal (>>=) :: HandshakeQuery side a -> (a -> HandshakeQuery side b) -> HandshakeQuery side b # (>>) :: HandshakeQuery side a -> HandshakeQuery side b -> HandshakeQuery side b # return :: a -> HandshakeQuery side a # |
handshakeQuery :: (Connection' -> IO a) -> HandshakeQuery side a Source #
newtype RustlsException Source #
TLS exception thrown by Rustls.
Use displayException
for a human-friendly representation.
Instances
Exception RustlsException Source # | |
Defined in Rustls.Internal | |
Show RustlsException Source # | |
Defined in Rustls.Internal showsPrec :: Int -> RustlsException -> ShowS # show :: RustlsException -> String # showList :: [RustlsException] -> ShowS # |
isCertError :: RustlsException -> Bool Source #
Checks if the given RustlsException
represents a certificate error.
newtype RustlsLogException Source #
Wrapper for exceptions thrown in a LogCallback
.
Instances
Exception RustlsLogException Source # | |
Defined in Rustls.Internal | |
Show RustlsLogException Source # | |
Defined in Rustls.Internal showsPrec :: Int -> RustlsLogException -> ShowS # show :: RustlsLogException -> String # showList :: [RustlsLogException] -> ShowS # |
data RustlsUnknownLogLevel Source #
Instances
Exception RustlsUnknownLogLevel Source # | |
Defined in Rustls.Internal | |
Show RustlsUnknownLogLevel Source # | |
Defined in Rustls.Internal showsPrec :: Int -> RustlsUnknownLogLevel -> ShowS # show :: RustlsUnknownLogLevel -> String # showList :: [RustlsUnknownLogLevel] -> ShowS # |
Underlying data source for Rustls.
mkSocketBackend :: Socket -> Backend Source #
:: (Int -> IO ByteString) | Read a This will silently truncate |
-> (ByteString -> IO ()) | Write a |
-> Backend |
An in-memory Backend
.
data Connection' Source #
withConnection :: Connection side -> (Connection' -> IO a) -> IO a Source #
data ReadOrWrite Source #
Messages sent to the background thread.
Request ReadOrWrite | Request to start a read or a write FFI call from the background thread.
It should respond with |
Done IOResult | Notify the background thread that we are done interacting with the buffer. |
Messages sent from the background thread.
interactTLS :: Connection' -> ReadOrWrite -> IO CSize Source #
completeIO :: Connection' -> IO IsEOF Source #
Helper function, see complete_io
from rustls.
https://github.com/rustls/rustls/blob/v/0.23.4/rustls/src/conn.rs#L544
completePriorIO :: Connection' -> IO () Source #
getIsHandshaking :: Connection' -> IO Bool Source #
getWantsRead :: Connection' -> IO Bool Source #
getWantsWrite :: Connection' -> IO Bool Source #
loopWhileTrue :: Monad m => m Bool -> m () Source #
cSizeToInt :: CSize -> Int Source #
intToCSize :: Int -> CSize Source #
ignoreExceptions :: IO () -> IO () Source #
ignoreSyncExceptions :: IO () -> IO () Source #