tlsdefaults

package
v0.0.0-...-8b1022e Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2016 License: Apache-2.0, Apache-2.0 Imports: 6 Imported by: 0

README

tlsdefaults provides sensible defaults for using TLS with Go.

Documentation

Overview

Package tlsdefaults provides sensible defaults for using TLS.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Listen

func Listen(addr, pkfile, certfile string) (net.Listener, error)

Listen opens a TLS listener at the given address using the private key and certificate PEM files at the given paths. If no files exists, it creates a new key and self-signed certificate at those locations.

func NewListener

func NewListener(l net.Listener, pkfile, certfile string) (net.Listener, error)

NewListener creates a TLS listener based on the given listener using the private key and certificate PEM files at the given paths. If no files exists, it creates a new key and self-signed certificate at those locations.

func Server

func Server() *tls.Config

Server provides a tls.Config with sensible defaults for server use. At this point, it mostly trusts the defaults from Go (assumes Go version 1.5 or or newer).

Types

type CertContext

type CertContext struct {
	PKFile         string
	ServerCertFile string
	PK             *keyman.PrivateKey
	ServerCert     *keyman.Certificate
}

CertContext encapsulates the certificates used by a Server

Jump to

Keyboard shortcuts

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