Documentation ¶
Index ¶
- func ParseCertificate(certPEM, keyPEM []byte, password ...string) (tls.Certificate, error)
- func ParseCertificateFile(certFile, keyFile string, password ...string) (tls.Certificate, error)
- func PoolFromPem(pem []byte) (pool *x509.CertPool, ok bool)
- func PoolFromPemFile(pemFile string) (*x509.CertPool, error)
- type ClientTLSConfigOptions
- func (o *ClientTLSConfigOptions) TLSConfig() (*tls.Config, error)
- func (o *ClientTLSConfigOptions) WithCA(caFilePath string) *ClientTLSConfigOptions
- func (o *ClientTLSConfigOptions) WithCAPem(pem []byte) *ClientTLSConfigOptions
- func (o *ClientTLSConfigOptions) WithClientCertificate(clientCertFile string, clientKeyFile string) *ClientTLSConfigOptions
- func (o *ClientTLSConfigOptions) WithClientCertificatePem(clientCertPem, clientKeyPem []byte) *ClientTLSConfigOptions
- func (o *ClientTLSConfigOptions) WithClientKeyPassword(password string) *ClientTLSConfigOptions
- func (o *ClientTLSConfigOptions) WithInsecure(insecure bool) *ClientTLSConfigOptions
- func (o *ClientTLSConfigOptions) WithServerName(serverName string) *ClientTLSConfigOptions
- type ServerTLSConfigOptions
- func (o *ServerTLSConfigOptions) TLSConfig() (*tls.Config, error)
- func (o *ServerTLSConfigOptions) WithCA(caFilePath string) *ServerTLSConfigOptions
- func (o *ServerTLSConfigOptions) WithCAPem(pem []byte) *ServerTLSConfigOptions
- func (o *ServerTLSConfigOptions) WithClientAuth(auth tls.ClientAuthType) *ServerTLSConfigOptions
- func (o *ServerTLSConfigOptions) WithServerCertificate(serverCertFile string, serverKeyFile string) *ServerTLSConfigOptions
- func (o *ServerTLSConfigOptions) WithServerCertificatePem(serverCertPem, serverKeyPem []byte) *ServerTLSConfigOptions
- func (o *ServerTLSConfigOptions) WithServerKeyPassword(password string) *ServerTLSConfigOptions
- type TLSConfigOptionsdeprecated
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseCertificate ¶
func ParseCertificate(certPEM, keyPEM []byte, password ...string) (tls.Certificate, error)
ParseCertificate 解析 PEM 证书文件
func ParseCertificateFile ¶
func ParseCertificateFile(certFile, keyFile string, password ...string) (tls.Certificate, error)
Types ¶
type ClientTLSConfigOptions ¶ added in v0.4.31
type ClientTLSConfigOptions struct { CaPem []byte CaFilePath string ClientCertPem []byte ClientCertFile string ClientKeyPem []byte ClientKeyFile string ClientKeyPassword string ServerName string // override default server name verification Insecure bool }
func (*ClientTLSConfigOptions) TLSConfig ¶ added in v0.4.31
func (o *ClientTLSConfigOptions) TLSConfig() (*tls.Config, error)
func (*ClientTLSConfigOptions) WithCA ¶ added in v0.4.31
func (o *ClientTLSConfigOptions) WithCA(caFilePath string) *ClientTLSConfigOptions
func (*ClientTLSConfigOptions) WithCAPem ¶ added in v0.4.31
func (o *ClientTLSConfigOptions) WithCAPem(pem []byte) *ClientTLSConfigOptions
func (*ClientTLSConfigOptions) WithClientCertificate ¶ added in v0.4.31
func (o *ClientTLSConfigOptions) WithClientCertificate(clientCertFile string, clientKeyFile string) *ClientTLSConfigOptions
func (*ClientTLSConfigOptions) WithClientCertificatePem ¶ added in v0.4.31
func (o *ClientTLSConfigOptions) WithClientCertificatePem(clientCertPem, clientKeyPem []byte) *ClientTLSConfigOptions
func (*ClientTLSConfigOptions) WithClientKeyPassword ¶ added in v0.4.31
func (o *ClientTLSConfigOptions) WithClientKeyPassword(password string) *ClientTLSConfigOptions
func (*ClientTLSConfigOptions) WithInsecure ¶ added in v0.4.31
func (o *ClientTLSConfigOptions) WithInsecure(insecure bool) *ClientTLSConfigOptions
func (*ClientTLSConfigOptions) WithServerName ¶ added in v0.4.32
func (o *ClientTLSConfigOptions) WithServerName(serverName string) *ClientTLSConfigOptions
type ServerTLSConfigOptions ¶ added in v0.4.31
type ServerTLSConfigOptions struct { ServerCertPem []byte ServerCertFile string ServerKeyPem []byte ServerKeyFile string ServerKeyPassword string ClientAuth tls.ClientAuthType // for client auth CaPem []byte // for client auth CaFilePath string // for client auth }
func (*ServerTLSConfigOptions) TLSConfig ¶ added in v0.4.31
func (o *ServerTLSConfigOptions) TLSConfig() (*tls.Config, error)
func (*ServerTLSConfigOptions) WithCA ¶ added in v0.4.31
func (o *ServerTLSConfigOptions) WithCA(caFilePath string) *ServerTLSConfigOptions
func (*ServerTLSConfigOptions) WithCAPem ¶ added in v0.4.31
func (o *ServerTLSConfigOptions) WithCAPem(pem []byte) *ServerTLSConfigOptions
func (*ServerTLSConfigOptions) WithClientAuth ¶ added in v0.4.31
func (o *ServerTLSConfigOptions) WithClientAuth(auth tls.ClientAuthType) *ServerTLSConfigOptions
func (*ServerTLSConfigOptions) WithServerCertificate ¶ added in v0.4.31
func (o *ServerTLSConfigOptions) WithServerCertificate(serverCertFile string, serverKeyFile string) *ServerTLSConfigOptions
func (*ServerTLSConfigOptions) WithServerCertificatePem ¶ added in v0.4.31
func (o *ServerTLSConfigOptions) WithServerCertificatePem(serverCertPem, serverKeyPem []byte) *ServerTLSConfigOptions
func (*ServerTLSConfigOptions) WithServerKeyPassword ¶ added in v0.4.31
func (o *ServerTLSConfigOptions) WithServerKeyPassword(password string) *ServerTLSConfigOptions
type TLSConfigOptions
deprecated
type TLSConfigOptions = ClientTLSConfigOptions
TLSConfigOptions
Deprecated: use ClientTLSConfigOptions instead
Click to show internal directories.
Click to hide internal directories.