certs

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2021 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CertManager

type CertManager struct {
	// contains filtered or unexported fields
}

CertManager is the object responsible for managing the certificates globally for the virtual hosts of the reverse proxy

func NewCertManager

func NewCertManager(manager *autocert.Manager) *CertManager

NewCertManager returns a new object of CertManager type

func (*CertManager) AddAutoCertificate

func (certManager *CertManager) AddAutoCertificate(vhostName string)

AddAutoCertificate registers a virtual host to obtain an automatic Let's encrypt certificate

func (*CertManager) AddCertificate

func (certManager *CertManager) AddCertificate(vhostName string, certificate *tls.Certificate)

AddCertificate adds a certificate to use on a virtual host

func (*CertManager) AddClientCA

func (certManager *CertManager) AddClientCA(authorizedCA []string)

AddClientCA registers a list of certificate authorities to use with the reverse proxy

func (*CertManager) GetTlsConfig

func (certManager *CertManager) GetTlsConfig() *tls.Config

GetTlsConfig gets the config structure to configure a TSL server

func (*CertManager) HasCertificateFor added in v1.0.7

func (certManager *CertManager) HasCertificateFor(vhostName string) bool

HasCertificateFor indicates if already exists a certificate for de vhostname

type CertificateDefs

type CertificateDefs struct {
	CaPem      string `json:"ca_pem"`
	PublicKey  string `json:"public_key"`
	PrivateKey string `json:"private_key"`
}

CertificateDefs is the structure that contains the public and private key of the certificate and the public key of the certificate authority to establish secure communication between reverse proxy and virtual host.

func (*CertificateDefs) GetCertificate

func (certificateDefs *CertificateDefs) GetCertificate() *tls.Certificate

GetCertificate gets the TLS certificate using the public and private key.

func (*CertificateDefs) GetTlsConfig

func (certificateDefs *CertificateDefs) GetTlsConfig() *tls.Config

GetTlsConfig gets the config structure to configure a TSL client.

Jump to

Keyboard shortcuts

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