Documentation ¶
Index ¶
- Variables
- func Certificate(cert interface{}, key interface{}) (*tls.Certificate, error)
- func MustCertificate(cert interface{}, key interface{}) *tls.Certificate
- func MustRootCAsBytes(rootCAs []interface{}) *x509.CertPool
- func MustTlsConfig(options ...Option) *tls.Config
- func RootCAsBytes(rootCAs []interface{}) (*x509.CertPool, error)
- func TlsConfig(options ...Option) (*tls.Config, error)
- type Option
- func MustCerts(rootCa string, certFile string, keyFile string) []Option
- func WithCertificates(certificates []tls.Certificate) Option
- func WithClientAuth(clientauth tls.ClientAuthType) Option
- func WithClientCAs(clientcas *x509.CertPool) Option
- func WithInsecureSkipVerify(insecureskipverify bool) Option
- func WithRootCAs(rootcas *x509.CertPool) Option
Constants ¶
This section is empty.
Variables ¶
View Source
var MultiCertFormatErr = errors.New("multi cert format error")
View Source
var UnexpectCertFormatErr = errors.New("unexpect cert format error")
Functions ¶
func Certificate ¶
func Certificate(cert interface{}, key interface{}) (*tls.Certificate, error)
func MustCertificate ¶
func MustCertificate(cert interface{}, key interface{}) *tls.Certificate
func MustRootCAsBytes ¶
func MustTlsConfig ¶
func RootCAsBytes ¶
Types ¶
type Option ¶
type Option func(*tlsWith)
Option is a tlsWith configurator to be supplied to NewtlsWith() function.
func WithCertificates ¶
func WithCertificates(certificates []tls.Certificate) Option
WithCertificates sets the Certificates
func WithClientAuth ¶
func WithClientAuth(clientauth tls.ClientAuthType) Option
WithClientAuth sets the ClientAuth
func WithClientCAs ¶
WithClientCAs sets the ClientCAs
func WithInsecureSkipVerify ¶
WithInsecureSkipVerify sets the InsecureSkipVerify
Click to show internal directories.
Click to hide internal directories.