pinned

package
v0.0.0-...-0fbe54b Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2014 License: BSD-3-Clause Imports: 6 Imported by: 6

Documentation

Overview

Package pinned provides a dial function that checks TLS server certificates against local pins.

Index

Constants

This section is empty.

Variables

View Source
var ErrPinFailure = errors.New("pinned: the peer leaf certificate did not match the provided pin")

Functions

This section is empty.

Types

type Config

type Config struct {
	// Hash specifies the hash function to use to check the Pin, it defaults to
	// sha256.New.
	Hash func() hash.Hash

	// Pin defines the expected digest of the peer's leaf certificate.
	Pin []byte

	// Config is used as the base TLS configuration, if set.
	Config *tls.Config
}

func (*Config) Dial

func (c *Config) Dial(network, addr string) (net.Conn, error)

Dial establishes a TLS connection to addr and checks the peer leaf certificate against the configured pin. The underlying type of the returned net.Conn is a Conn.

type Conn

type Conn struct {
	*tls.Conn
	Wire net.Conn
}

func (Conn) CloseWrite

func (c Conn) CloseWrite() error

Jump to

Keyboard shortcuts

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