Documentation
¶
Index ¶
- Variables
- func AutocertManagerFromConfig(c AutoCertConfig) *autocert.Manager
- func ConvertClientConfig(c ClientConfig) (*tls.Config, error)
- func ConvertServerConfig(c ServerConfig) (*tls.Config, error)
- func CreateAndSaveSelfSignedKeyPair(config SelfSignedConfig, certPath, keyPath string) (*tls.Certificate, *x509.CertPool, error)
- func CreateSelfSignedKeyPair(config SelfSignedConfig) (*tls.Certificate, *x509.CertPool, error)
- func LoadCertPoolFromFile(certPoolPath string) (*x509.CertPool, error)
- func LoadKeyPairAndCertsFromFile(path string) (*tls.Certificate, error)
- func LoadKeyPairFromFiles(certPath, keyPath string) (*tls.Certificate, error)
- func LoadX509CertFromFile(certPath string) (*x509.Certificate, error)
- func SaveTLSCertificateToFiles(cert *tls.Certificate, certPath, keyPath string) error
- type AutoCertConfig
- type ClientConfig
- type SelfSignedConfig
- type ServerConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var ( EmptyClientConfig = ClientConfig{} EmptyServerConfig = ServerConfig{} EmptyAutoCertConfig = AutoCertConfig{} )
Functions ¶
func AutocertManagerFromConfig ¶ added in v0.36.0
func AutocertManagerFromConfig(c AutoCertConfig) *autocert.Manager
func ConvertClientConfig ¶
func ConvertClientConfig(c ClientConfig) (*tls.Config, error)
func ConvertServerConfig ¶
func ConvertServerConfig(c ServerConfig) (*tls.Config, error)
func CreateAndSaveSelfSignedKeyPair ¶
func CreateAndSaveSelfSignedKeyPair(config SelfSignedConfig, certPath, keyPath string) (*tls.Certificate, *x509.CertPool, error)
func CreateSelfSignedKeyPair ¶
func CreateSelfSignedKeyPair(config SelfSignedConfig) (*tls.Certificate, *x509.CertPool, error)
pulled from inet.af/tcpproxy
func LoadKeyPairAndCertsFromFile ¶
func LoadKeyPairAndCertsFromFile(path string) (*tls.Certificate, error)
LoadKeyPairAndCertsFromFile From: https://gist.github.com/ukautz/cd118e298bbd8f0a88fc LoadKeyPairAndCertsFromFile reads file, divides into key and certificates
func LoadKeyPairFromFiles ¶
func LoadKeyPairFromFiles(certPath, keyPath string) (*tls.Certificate, error)
func LoadX509CertFromFile ¶
func LoadX509CertFromFile(certPath string) (*x509.Certificate, error)
func SaveTLSCertificateToFiles ¶
func SaveTLSCertificateToFiles(cert *tls.Certificate, certPath, keyPath string) error
Types ¶
type AutoCertConfig ¶
type AutoCertConfig struct {
CacheDirectory string `mapstructure:"cache-directory" json:",omitempty"`
Email string `mapstructure:"email" json:",omitempty"`
AllowedHosts []string `mapstructure:"allowed-hosts" json:",omitempty"`
DirectoryURL string `mapstructure:"directory-url" json:",omitempty"`
}
func (AutoCertConfig) IsEmpty ¶
func (c AutoCertConfig) IsEmpty() bool
type ClientConfig ¶
type ClientConfig struct {
RootCAFile string `mapstructure:"root-ca-file" json:",omitempty"`
Certificate string `mapstructure:"cert" json:",omitempty"`
Key string `mapstructure:"key" json:",omitempty"`
InsecureSkipVerify bool `mapstructure:"insecure-skip-verify"`
}
func (ClientConfig) IsEmpty ¶
func (c ClientConfig) IsEmpty() bool
type SelfSignedConfig ¶
type ServerConfig ¶
type ServerConfig struct {
ServerName string `mapstructure:"server-name"`
AutoCertConfig AutoCertConfig `mapstructure:"auto-cert-config"`
SinglePEMFile string `mapstructure:"single-pem-file" json:",omitempty"`
Certificate string `mapstructure:"cert" json:",omitempty"`
Key string `mapstructure:"key" json:",omitempty"`
FileWaitInterval int `mapstructure:"file-wait-interval" json:",omitempty"`
FileWaitMax int `mapstructure:"file-wait-max" json:",omitempty"`
ClientAuthType string `mapstructure:"client-auth-type" json:",omitempty"`
ClientCAFile string `mapstructure:"client-ca-file" json:",omitempty"`
NextProtos []string `mapstructure:"next-protos"`
}
func (ServerConfig) IsEmpty ¶
func (s ServerConfig) IsEmpty() bool
Click to show internal directories.
Click to hide internal directories.