tls

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package tls provides implementation of Go API for tls certificate provider

Package tls provides implementation of Go API for tls certificate provider

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewX509CertPool

func NewX509CertPool(path string) (pool *x509.CertPool, err error)

NewX509CertPool returns *x509.CertPool struct or error. The CertPool will read the certificate from the path, and append the content to the system certificate pool, and return.

Types

type Config

type Config = tls.Config

func New

func New(opts ...Option) (*Config, error)

NewTLSConfig returns a *tls.Config struct or error This function read TLS configuration and initialize *tls.Config struct. This function initialize TLS configuration, for example the CA certificate and key to start TLS server. Server and CA Certificate, and private key will read from a file from the file path definied in environment variable.

func NewClientConfig

func NewClientConfig(opts ...Option) (*Config, error)

type Conn added in v1.0.2

type Conn = tls.Conn

func Client added in v1.0.2

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

type Option

type Option func(*credentials) error

func WithCa

func WithCa(ca string) Option

func WithCert

func WithCert(cert string) Option

func WithInsecureSkipVerify added in v1.0.2

func WithInsecureSkipVerify(insecure bool) Option

func WithKey

func WithKey(key string) Option

func WithTLSConfig

func WithTLSConfig(cfg *tls.Config) Option

Jump to

Keyboard shortcuts

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