tls

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2017 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VersionSSL30 = 0x0300
	VersionTLS10 = 0x0301
	VersionTLS11 = 0x0302
	VersionTLS12 = 0x0303
)

Variables

View Source
var CipherSuites = []CipherSuite{}/* 326 elements not displayed */
View Source
var ProtocolVersions = []ProtocolVersion{
	{ID: VersionSSL30, Name: "VersionSSL30"},
	{ID: VersionTLS10, Name: "VersionTLS10"},
	{ID: VersionTLS11, Name: "VersionTLS11"},
	{ID: VersionTLS12, Name: "VersionTLS12"},
}

Functions

func Dial

func Dial(ctx context.Context, network, addr string, config *Config) error

Types

type CipherSuite

type CipherSuite struct {
	ID   uint16
	Name string
}

type Config

type Config struct {
	Version     uint16
	CipherSuite uint16
	ServerName  string
}

type Conn

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

A Conn represents a secured connection. It implements the net.Conn interface.

func Client

func Client(conn net.Conn, config *Config) *Conn

func (*Conn) Close

func (c *Conn) Close() error

Close closes the connection.

func (*Conn) Handshake

func (c *Conn) Handshake() error

Handshake runs the client or server handshake protocol if it has not yet been run. Most uses of this package need not call Handshake explicitly: the first Read or Write will call it automatically.

type CurveID

type CurveID uint16

CurveID is the type of a TLS identifier for an elliptic curve. See http://www.iana.org/assignments/tls-parameters/tls-parameters.xml#tls-parameters-8

const (
	CurveP256 CurveID = 23
	CurveP384 CurveID = 24
	CurveP521 CurveID = 25
	X25519    CurveID = 29
)

type ProtocolVersion

type ProtocolVersion struct {
	ID   uint16
	Name string
}

type RecordHeaderError

type RecordHeaderError struct {
	// Msg contains a human readable string that describes the error.
	Msg string
	// RecordHeader contains the five bytes of TLS record header that
	// triggered the error.
	RecordHeader [5]byte
}

RecordHeaderError results when a TLS record header is invalid.

func (RecordHeaderError) Error

func (e RecordHeaderError) Error() string

Jump to

Keyboard shortcuts

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