acme

package
v3.2.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 25, 2026 License: BSD-3-Clause Imports: 37 Imported by: 0

Documentation

Index

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"
)
View Source
const (
	KeyEC256   = KeyType("P256")
	KeyEC384   = KeyType("P384")
	KeyRSA2048 = KeyType("2048")
	KeyRSA3072 = KeyType("3072")
	KeyRSA4096 = KeyType("4096")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Certificate

type Certificate struct {
	PrivateKey []byte
	acme.Certificate
}

type Client

type Client struct {
	Account acme.Account
	// contains filtered or unexported fields
}

func NewPrivateKeyAccount

func NewPrivateKeyAccount(email string, privateKey string, CA string, eab *EAB, log *slog.Logger) (*Client, error)

func NewRegisterAccount

func NewRegisterAccount(ctx context.Context, email, CA string, eab *EAB, keyType KeyType, log *slog.Logger) (*Client, error)

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) RenewCertificate

func (c *Client) RenewCertificate(ctx context.Context, certUrl string, domains []string, keyType KeyType) (Certificate, error)

RenewCertificate 续签 SSL 证书

func (*Client) UseDns

func (c *Client) UseDns(dnsType DnsType, param DNSParam, opt ...DnsOption)

UseDns 使用 DNS 接口验证

func (*Client) UseHTTP

func (c *Client) UseHTTP(conf string, webServer string)

UseHTTP 使用 HTTP 验证 conf 配置文件路径 webServer web 服务器类型 ("nginx" 或 "apache")

func (*Client) UsePanel

func (c *Client) UsePanel(ip []string, conf string, webServer string)

UsePanel 使用面板 HTTP 验证 ip 外网访问 IP 地址 conf 配置文件路径 webServer web 服务器类型 ("nginx" 或 "apache")

type DNSParam

type DNSParam struct {
	AK         string `form:"ak" json:"ak"`
	SK         string `form:"sk" json:"sk"`
	DnsServer  string `form:"dns_server" json:"dns_server"`   // DNS 验证服务器
	SkipVerify bool   `form:"skip_verify" json:"skip_verify"` // 跳过解析验证
}

type DNSProvider

type DNSProvider interface {
	libdns.RecordSetter
	libdns.RecordDeleter
}

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 DnsType

type DnsType string
const (
	AliYun     DnsType = "aliyun"
	Tencent    DnsType = "tencent"
	Huawei     DnsType = "huawei"
	Westcn     DnsType = "westcn"
	CloudFlare DnsType = "cloudflare"
	Gcore      DnsType = "gcore"
	Porkbun    DnsType = "porkbun"
	NameSilo   DnsType = "namesilo"
	ClouDNS    DnsType = "cloudns"
)

type EAB

type EAB = acme.EAB

type KeyType

type KeyType string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL