Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type TLSConfig ¶
type TLSConfig struct {
// 证书文件路径
CertFile string
// 私钥文件路径
KeyFile string
// CA证书文件路径
CAFile string
// 是否验证客户端证书
ClientAuth tls.ClientAuthType
// 服务名
ServerName string
// 最小TLS版本
MinVersion uint16
// 最大TLS版本
MaxVersion uint16
// 是否启用OCSP校验
EnableOCSP bool
// 允许的密码套件
CipherSuites []uint16
// 证书轮转检查间隔
RotationInterval time.Duration
// OCSP检查间隔
OCSPCheckInterval time.Duration
// 证书过期前预警时间
ExpiryWarningPeriod time.Duration
// contains filtered or unexported fields
}
TLSConfig 是TLS配置的强化版
func (*TLSConfig) AutoRotate ¶
AutoRotate 配置证书自动轮转
func (*TLSConfig) SetupClientConfig ¶
SetupClientConfig 设置客户端TLS配置
func (*TLSConfig) SetupServerConfig ¶
SetupServerConfig 设置服务端TLS配置
func (*TLSConfig) ToGRPCOptions ¶
func (t *TLSConfig) ToGRPCOptions() (credentials.TransportCredentials, error)
ToGRPCOptions 生成gRPC TLS选项
Click to show internal directories.
Click to hide internal directories.