acme

package
v2.2.27 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2024 License: AGPL-3.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CALetsEncryptStaging = "https://acme-staging-v02.api.letsencrypt.org/directory"
	CALetsEncrypt        = "https://acme-v02.api.letsencrypt.org/directory"
	CAZeroSSL            = "https://acme.zerossl.com/v2/DV90"
	CAGoogle             = "https://dv.acme-v02.api.pki.goog/directory"
	CABuypass            = "https://api.buypass.com/acme/directory"
	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

func GenerateSelfSignedSSL

func GenerateSelfSignedSSL(domains []string) ([]byte, []byte, error)

GenerateSelfSignedSSL 生成自签名证书

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) (*Client, error)

func NewRegisterAccount

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

func (Client) CleanUp

func (s Client) CleanUp(_ context.Context, _ acme.Challenge) error

func (*Client) GetDNSRecords

func (c *Client) GetDNSRecords(ctx context.Context, domains []string, keyType KeyType) ([]DNSRecord, error)

GetDNSRecords 获取 DNS 解析(手动设置)

func (*Client) ObtainSSL

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

ObtainSSL 签发 SSL 证书

func (*Client) ObtainSSLManual

func (c *Client) ObtainSSLManual() (Certificate, error)

ObtainSSLManual 手动验证 SSL 证书

func (Client) Present

func (s Client) Present(ctx context.Context, challenge acme.Challenge) error

func (*Client) RenewSSL

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

RenewSSL 续签 SSL 证书

func (*Client) UseDns

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

UseDns 使用 DNS 接口验证

func (*Client) UseHTTP

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

UseHTTP 使用 HTTP 验证 conf openresty 配置文件路径 path 验证文件存放路径

func (*Client) UseManualDns

func (c *Client) UseManualDns(total int, check ...bool)

UseManualDns 使用手动 DNS 验证

type DNSParam

type DNSParam struct {
	ID        string `form:"id" json:"id"`
	Token     string `form:"token" json:"token"`
	AccessKey string `form:"access_key" json:"access_key"`
	SecretKey string `form:"secret_key" json:"secret_key"`
	APIkey    string `form:"api_key" json:"api_key"`
}

type DNSProvider

type DNSProvider interface {
	libdns.RecordAppender
	libdns.RecordDeleter
}

type DNSRecord

type DNSRecord struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

type DnsType

type DnsType string
const (
	DnsPod     DnsType = "dnspod"
	Tencent    DnsType = "tencent"
	AliYun     DnsType = "aliyun"
	CloudFlare DnsType = "cloudflare"
)

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