tls

package
v0.0.46 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2020 License: Apache-2.0 Imports: 5 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) (*x509.CertPool, 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 Option

type Option func(*credentials) error

func WithCa

func WithCa(ca string) Option

func WithCert

func WithCert(cert string) 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