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 TLSConfigOptions
- func (o *TLSConfigOptions) TLSConfig() (*tls.Config, error)
- func (o *TLSConfigOptions) WithCA(caFilePath string) *TLSConfigOptions
- func (o *TLSConfigOptions) WithCAPem(pem []byte) *TLSConfigOptions
- func (o *TLSConfigOptions) WithClientCertificate(clientCertFile string, clientKeyFile string) *TLSConfigOptions
- func (o *TLSConfigOptions) WithClientCertificatePem(clientCertPem, clientKeyPem []byte) *TLSConfigOptions
- func (o *TLSConfigOptions) WithClientKeyPassword(password string) *TLSConfigOptions
- func (o *TLSConfigOptions) WithInsecure(insecure bool) *TLSConfigOptions
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 TLSConfigOptions ¶
type TLSConfigOptions struct { CaPem []byte CaFilePath string ClientCertPem []byte ClientCertFile string ClientKeyPem []byte ClientKeyFile string ClientKeyPassword string Insecure bool }
func (*TLSConfigOptions) WithCA ¶
func (o *TLSConfigOptions) WithCA(caFilePath string) *TLSConfigOptions
func (*TLSConfigOptions) WithCAPem ¶ added in v0.4.21
func (o *TLSConfigOptions) WithCAPem(pem []byte) *TLSConfigOptions
func (*TLSConfigOptions) WithClientCertificate ¶
func (o *TLSConfigOptions) WithClientCertificate(clientCertFile string, clientKeyFile string) *TLSConfigOptions
func (*TLSConfigOptions) WithClientCertificatePem ¶ added in v0.4.21
func (o *TLSConfigOptions) WithClientCertificatePem(clientCertPem, clientKeyPem []byte) *TLSConfigOptions
func (*TLSConfigOptions) WithClientKeyPassword ¶
func (o *TLSConfigOptions) WithClientKeyPassword(password string) *TLSConfigOptions
func (*TLSConfigOptions) WithInsecure ¶
func (o *TLSConfigOptions) WithInsecure(insecure bool) *TLSConfigOptions
Click to show internal directories.
Click to hide internal directories.