| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
LibP2P.Security.TLS
Description
libp2p TLS 1.3 secure channel with mutual peer authentication.
Synopsis
- data TLSRole
- data TLSHandshakeResult = TLSHandshakeResult {
- tlsRemotePeerId :: !PeerId
- tlsNegotiatedALPN :: !(Maybe ByteString)
- tlsStream :: !StreamIO
- tlsClose :: !(IO ())
- performTLSHandshake :: KeyPair -> TLSRole -> StreamIO -> IO TLSHandshakeResult
- performTLSHandshakeWithMuxers :: [ProtocolId] -> KeyPair -> TLSRole -> StreamIO -> IO TLSHandshakeResult
- tlsProtocolId :: ProtocolId
- yamuxProtocolId :: ProtocolId
- libp2pALPN :: ByteString
Documentation
TLS endpoint role on a libp2p byte stream.
data TLSHandshakeResult Source #
Authenticated TLS channel and the ALPN result selected by the peer.
Constructors
| TLSHandshakeResult | |
Fields
| |
performTLSHandshake :: KeyPair -> TLSRole -> StreamIO -> IO TLSHandshakeResult Source #
Perform a TLS 1.3 handshake with Yamux offered for inlined negotiation.
performTLSHandshakeWithMuxers :: [ProtocolId] -> KeyPair -> TLSRole -> StreamIO -> IO TLSHandshakeResult Source #
Perform a TLS 1.3 mutual-authentication handshake, advertising the given
muxers through ALPN and retaining libp2p as the required fallback.
tlsProtocolId :: ProtocolId Source #
multistream-select protocol ID for the libp2p TLS handshake.
yamuxProtocolId :: ProtocolId Source #
Yamux protocol ID, also used as its inlined TLS ALPN value.