| Safe Haskell | Safe-Inferred |
|---|---|
| Language | GHC2021 |
Rustls.Internal
Description
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.
Constructors
| ALPNProtocol | |
Fields | |
Instances
newtype CipherSuite Source #
A TLS cipher suite supported by Rustls.
Constructors
| CipherSuite (ConstPtr SupportedCipherSuite) |
Instances
| Show CipherSuite Source # | |
Defined in Rustls.Internal Methods showsPrec :: Int -> CipherSuite -> ShowS # show :: CipherSuite -> String # showList :: [CipherSuite] -> ShowS # | |
| Eq CipherSuite Source # | |
Defined in Rustls.Internal | |
| Ord CipherSuite Source # | |
Defined in Rustls.Internal Methods 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.
Constructors
| ClientConfigBuilder | |
Fields
| |
Instances
data ServerCertVerifier Source #
How to verify TLS server certificates.
Constructors
| ServerCertVerifier | |
Fields
| |
Instances
| Generic ServerCertVerifier Source # | |
Defined in Rustls.Internal Associated Types type Rep ServerCertVerifier :: Type -> Type # Methods from :: ServerCertVerifier -> Rep ServerCertVerifier x # to :: Rep ServerCertVerifier x -> ServerCertVerifier # | |
| Show ServerCertVerifier Source # | |
Defined in Rustls.Internal Methods 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.
Constructors
| 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.
Constructors
| 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.
Constructors
| CertifiedKey | |
Fields
| |
Instances
| Generic CertifiedKey Source # | |
Defined in Rustls.Internal Associated Types type Rep CertifiedKey :: Type -> Type # | |
| Show CertifiedKey Source # | |
Defined in Rustls.Internal Methods 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.
Constructors
| ClientConfig | |
Fields
| |
data ClientCertVerifier Source #
How to verify TLS client certificates.
Constructors
| ClientCertVerifier | |
Fields
| |
Instances
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
newtype CertificateRevocationList Source #
One or more PEM-encoded certificate revocation lists (CRL).
Constructors
| CertificateRevocationList | |
Fields | |
Instances
| Generic CertificateRevocationList Source # | |
Defined in Rustls.Internal Associated Types type Rep CertificateRevocationList :: Type -> Type # Methods from :: CertificateRevocationList -> Rep CertificateRevocationList x # to :: Rep CertificateRevocationList x -> CertificateRevocationList # | |
| Show CertificateRevocationList Source # | |
Defined in Rustls.Internal Methods 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.
Constructors
| ServerConfigBuilder | |
Fields
| |
Instances
data ServerConfig Source #
Assembled configuration for a Rustls server connection.
Constructors
| ServerConfig | |
Fields
| |
Rustls log level.
Constructors
| LogLevelError | |
| LogLevelWarn | |
| LogLevelInfo | |
| LogLevelDebug | |
| LogLevelTrace |
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 HandshakeQuery (side :: Side) a Source #
Constructors
| HandshakeQuery (ReaderT Connection' IO a) |
Instances
| Applicative (HandshakeQuery side) Source # | |
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 # | |
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 # | |
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 # | |
handshakeQuery :: (Connection' -> IO a) -> HandshakeQuery side a Source #
newtype RustlsException Source #
TLS exception thrown by Rustls.
Use displayException for a human-friendly representation.
Constructors
| RustlsException | |
Fields | |
Instances
| Exception RustlsException Source # | |
Defined in Rustls.Internal Methods toException :: RustlsException -> SomeException # | |
| Show RustlsException Source # | |
Defined in Rustls.Internal Methods 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.
Constructors
| RustlsLogException SomeException |
Instances
| Exception RustlsLogException Source # | |
Defined in Rustls.Internal Methods toException :: RustlsLogException -> SomeException # fromException :: SomeException -> Maybe RustlsLogException # | |
| Show RustlsLogException Source # | |
Defined in Rustls.Internal Methods showsPrec :: Int -> RustlsLogException -> ShowS # show :: RustlsLogException -> String # showList :: [RustlsLogException] -> ShowS # | |
data RustlsUnknownLogLevel Source #
Constructors
| RustlsUnknownLogLevel LogLevel |
Instances
| Exception RustlsUnknownLogLevel Source # | |
Defined in Rustls.Internal | |
| Show RustlsUnknownLogLevel Source # | |
Defined in Rustls.Internal Methods showsPrec :: Int -> RustlsUnknownLogLevel -> ShowS # show :: RustlsUnknownLogLevel -> String # showList :: [RustlsUnknownLogLevel] -> ShowS # | |
Underlying data source for Rustls.
mkSocketBackend :: Socket -> Backend Source #
Arguments
| :: (Int -> IO ByteString) | Read a This will silently truncate |
| -> (ByteString -> IO ()) | Write a |
| -> Backend |
An in-memory Backend.
Type-level indicator whether a Connection is client- or server-side.
newtype Connection (side :: Side) Source #
A Rustls connection.
Constructors
| Connection (MVar Connection') |
data Connection' Source #
withConnection :: Connection side -> (Connection' -> IO a) -> IO a Source #
data ReadOrWrite 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 |
| 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 #