Documentation
¶
Index ¶
- func LoadCertPoolFromPEMFile(path string) (*x509.CertPool, error)
- func MustServerConfig(opts ServerConfigOptions) *tls.Config
- func NewClientConfig(opts ClientConfigOptions) (*tls.Config, error)
- func NewServerConfig(opts ServerConfigOptions) (*tls.Config, error)
- type ClientConfigOptions
- type ServerConfigOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadCertPoolFromPEMFile ¶
LoadCertPoolFromPEMFile 从 PEM 文件加载证书池。
func MustServerConfig ¶
func MustServerConfig(opts ServerConfigOptions) *tls.Config
MustServerConfig 构造服务端 TLS 配置,失败时 panic。
func NewClientConfig ¶
func NewClientConfig(opts ClientConfigOptions) (*tls.Config, error)
NewClientConfig 构造客户端 TLS 配置。
func NewServerConfig ¶
func NewServerConfig(opts ServerConfigOptions) (*tls.Config, error)
NewServerConfig 构造服务端 TLS 配置。
Types ¶
type ClientConfigOptions ¶
type ClientConfigOptions struct {
CAPath string
CertPath string
KeyPath string
ServerName string
InsecureSkipVerify bool
MinVersion uint16
}
ClientConfigOptions 描述客户端 TLS 配置来源。
type ServerConfigOptions ¶
ServerConfigOptions 描述服务端 TLS 配置来源。
Click to show internal directories.
Click to hide internal directories.