cmtls

package
v0.0.0-...-e18b226 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 14, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const ID = "/cmtls/1.0.0"

ID is the protocol ID (used when negotiating with multistream)

Variables

This section is empty.

Functions

func New

func New(
	tlsCfg *tls.Config,
) func(key crypto.PrivKey) (*Transport, error)

New return a function can create a new Transport instance.

Types

type Transport

type Transport struct {
	// contains filtered or unexported fields
}

Transport constructs secure communication sessions for a peer.

func (*Transport) SecureInbound

func (t *Transport) SecureInbound(ctx context.Context, insecure net.Conn) (sec.SecureConn, error)

SecureInbound runs the TLS handshake as a server.

func (*Transport) SecureOutbound

func (t *Transport) SecureOutbound(ctx context.Context, insecure net.Conn, p peer.ID) (sec.SecureConn, error)

SecureOutbound runs the TLS handshake as a client.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL