Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ACME ¶
type ACME struct {
Enabled bool `mapstructure:"enabled" yaml:"enabled"`
Email string `mapstructure:"email" yaml:"email"`
Domains []string `mapstructure:"domains" yaml:"domains"`
CacheDir string `mapstructure:"cache_dir" yaml:"cache_dir"`
}
ACME (Let's Encrypt) 配置
type Config ¶
type Config struct {
// 手动证书路径
CertFile string `mapstructure:"cert_file" yaml:"cert_file"`
KeyFile string `mapstructure:"key_file" yaml:"key_file"`
ACME ACME `mapstructure:"acme" yaml:"acme"`
// 降级阈值:如果手动证书还有多少天过期,就切换到 ACME (默认 30 天)
// 如果为 0,表示只有文件不存在或已完全过期才切换
FallbackThresholdDays int `mapstructure:"fallback_threshold_days" yaml:"fallback_threshold_days"`
}
func DefaultConfig ¶
func DefaultConfig() Config
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager 负责证书的获取、缓存、更新和降级策略。
func (*Manager) GetCertificate ¶
func (m *Manager) GetCertificate(hello *tls.ClientHelloInfo) (*tls.Certificate, error)
GetCertificate 实现 tls.Config.GetCertificate 这是一个高频调用的热点路径,实现了基于 atomic.Pointer 的无锁化读取。
func (*Manager) HTTPHandler ¶
HTTPHandler ACME 挑战处理器
Click to show internal directories.
Click to hide internal directories.