https

package
v0.0.0-...-6254df8 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(server *http.Server, cfg *tls.Config) chan error

Run starts an HTTPS server in a separate goroutine, returning a channel where you can wait for server exit.

Types

type MutualTLSConfig

type MutualTLSConfig struct {
	ClientCerts      []PemData
	ServerCert       PemData
	ServerCertPvtKey PemData
}

MutualTLSConfig holds the certificates and keys needed for mTLS.

func (*MutualTLSConfig) FromFiles

func (c *MutualTLSConfig) FromFiles(
	serverPvtKeyFile, serverCertFile, clientCertFile string) error

FromFiles populates MutualTLSConfig with the PEM data in the given files.

func (*MutualTLSConfig) ServerTLSConfig

func (c *MutualTLSConfig) ServerTLSConfig() (*tls.Config, error)

ServerTLSConfig builds an HTTPS server configuration for mTLS.

type PemData

type PemData string

PemData is a string containing certificates or keys in PEM format.

func PemDataFromFile

func PemDataFromFile(path string) (PemData, error)

PemDataFromFile reads PEM data from the specified file.

Jump to

Keyboard shortcuts

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