Documentation
¶
Index ¶
- Constants
- type Certificate
- type Client
- func (c *Client) GetRenewalInfo(ctx context.Context, cert x509.Certificate) (acme.RenewalInfo, error)
- func (c *Client) ObtainCertificate(ctx context.Context, sans []string, keyType KeyType) (Certificate, error)
- func (c *Client) ObtainIPCertificate(ctx context.Context, sans []string, keyType KeyType) (Certificate, error)
- func (c *Client) UseDns(dnsType DnsType, param DNSParam, opt ...DnsOption)
- func (c *Client) UseHTTP(confs map[string]string, fallback []string, writer HTTPChallengeWriter)
- func (c *Client) UsePanel(conf string, writer HTTPChallengeWriter)
- type DNSParam
- type DNSProvider
- type DnsOption
- type DnsType
- type EAB
- type HTTPChallengeWriter
- type KeyType
Constants ¶
View Source
const ( CAGoogleCN = "https://gts.rat.dev/directory" CAGoogle = "https://dv.acme-v02.api.pki.goog/directory" CALetsEncryptStaging = "https://acme-staging-v02.api.letsencrypt.org/directory" CALetsEncrypt = "https://acme-v02.api.letsencrypt.org/directory" CALiteSSL = "https://acme.litessl.com/acme/v2/directory" CAZeroSSL = "https://acme.zerossl.com/v2/DV90" CASSLcom = "https://acme.ssl.com/sslcom-dv-rsa" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Certificate ¶
type Certificate struct {
PrivateKey []byte
acme.Certificate
}
type Client ¶
func NewPrivateKeyAccount ¶
func NewRegisterAccount ¶
func (*Client) GetRenewalInfo ¶
func (c *Client) GetRenewalInfo(ctx context.Context, cert x509.Certificate) (acme.RenewalInfo, error)
GetRenewalInfo 获取续签建议
func (*Client) ObtainCertificate ¶
func (c *Client) ObtainCertificate(ctx context.Context, sans []string, keyType KeyType) (Certificate, error)
ObtainCertificate 签发 SSL 证书
func (*Client) ObtainIPCertificate ¶
func (c *Client) ObtainIPCertificate(ctx context.Context, sans []string, keyType KeyType) (Certificate, error)
ObtainIPCertificate 签发 IP SSL 证书
func (*Client) UseHTTP ¶
func (c *Client) UseHTTP(confs map[string]string, fallback []string, writer HTTPChallengeWriter)
UseHTTP 使用 HTTP 验证 confs 域名到配置文件路径的映射,token 会按域名投放到对应网站 fallback 域名未命中 confs 时写入的配置文件列表 writer 负责按 Web 服务器语法投放验证配置
func (*Client) UsePanel ¶
func (c *Client) UsePanel(conf string, writer HTTPChallengeWriter)
UsePanel 使用面板 HTTP 验证 conf 配置文件路径 writer 负责按 Web 服务器语法投放验证配置
type DNSProvider ¶
type DNSProvider interface {
libdns.RecordAppender
libdns.RecordDeleter
}
func NewDNSProvider ¶ added in v3.3.12
func NewDNSProvider(dnsType DnsType, param DNSParam) (DNSProvider, error)
NewDNSProvider 按提供商类型构造 libdns 客户端,供证书签发之外的模块(如邮件服务写 DNS 记录)复用
type DnsOption ¶ added in v3.2.0
type DnsOption struct {
Alias map[string]string // DNS 验证别名映射 (domain → delegated domain)
DnsServer string // DNS 验证服务器地址
SkipVerify bool // 跳过解析验证
ProgressCallback func(string) // 进度回调
}
DnsOption DNS 验证的可选配置
type HTTPChallengeWriter ¶ added in v3.3.6
type HTTPChallengeWriter interface {
WriteSiteChallenge(conf, path, token string) (bool, error)
RemoveSiteChallenge(conf, path, token string) (bool, error)
WritePanelChallenge(conf string, names []string, tokens map[string]string) (bool, error)
RemovePanelChallenge(conf string) (bool, error)
Reload(ctx context.Context) error
}
HTTPChallengeWriter 由 Web 服务器方言实现,bool 返回值表示配置是否变化,未变化则跳过重载
Click to show internal directories.
Click to hide internal directories.