package tlsconfig

import "github.com/docker/go-connections/tlsconfig"

Package tlsconfig provides primitives to retrieve secure-enough TLS configurations for both clients and servers.

As a reminder from https://golang.org/pkg/crypto/tls/#Config:

A Config structure is used to configure a TLS client or server. After one has been passed to a TLS function it must not be modified.
A Config may be reused; the tls package will also not modify it.

Package tlsconfig provides primitives to retrieve secure-enough TLS configurations for both clients and servers.

Index

Variables

var ClientDefault = tls.Config{

	MinVersion:   tls.VersionTLS12,
	CipherSuites: clientCipherSuites,
}

ClientDefault is a secure-enough TLS configuration for the client TLS configuration.

var DefaultServerAcceptedCiphers = append(clientCipherSuites, acceptedCBCCiphers...)

DefaultServerAcceptedCiphers should be uses by code which already has a crypto/tls options struct but wants to use a commonly accepted set of TLS cipher suites, with known weak algorithms removed.

var ServerDefault = tls.Config{

	MinVersion:               tls.VersionTLS10,
	PreferServerCipherSuites: true,
	CipherSuites:             DefaultServerAcceptedCiphers,
}

ServerDefault is a secure-enough TLS configuration for the server TLS configuration.

Functions

func Client

func Client(options Options) (*tls.Config, error)

Client returns a TLS configuration meant to be used by a client.

func Server

func Server(options Options) (*tls.Config, error)

Server returns a TLS configuration meant to be used by a server.

Types

type Options

type Options struct {
	CAFile string

	// If either CertFile or KeyFile is empty, Client() will not load them
	// preventing the client from authenticating to the server.
	// However, Server() requires them and will error out if they are empty.
	CertFile string
	KeyFile  string

	// client-only option
	InsecureSkipVerify bool
	// server-only option
	ClientAuth tls.ClientAuthType
}

Options represents the information needed to create client and server TLS configurations.

Source Files

config.go config_client_ciphers.go

Version
v0.1.3
Published
Feb 3, 2016
Platform
js/wasm
Imports
6 packages
Last checked
8 hours ago

Tools for package owners.