使用 ACME.SH 申请 Google CA SSL 证书
前言最近谷歌开放了自家的 GTS CA(Google Trust Services),谷歌作为全球大厂那不得好好嫖一下!目前该服务进入了 Public Review 阶段,不再需要申请内测资格,而且支持 acme.sh 快速申请,那不就是嫖他的好日子来了吗!证书简介GTS SSL 证书的特点是支持 IP 地址块持有者申请 IP 地址证书根 CA 为 GlobalSign,根 CA 的支持性和兼容性比 Let’s Encrypt 好支持安全性和性能更好的ECC 证书支持多域名、泛域名证书申请(例如*.cestlavie.moe)有效期为90 天支持的 ACME 验证方式为TLS-ALPN-01、HTTP-01、和 DNS-01暂不支持邮箱验证方式申请暂不支持以国际化域名编码的域名
获取注册密钥打开shell.cloud.google.com,输入以下代码$ gcloud beta publicca external-account-keys create #创建凭据回显为$ gcloud beta publicca external-account-keys createAPI [publicca.googleapis.com] not enabled on project [<projectid>]. Would you like to enable and retry (this will take a few minutes)? (y/N)? y #允许创建 publica APIEnabling service [publicca.googleapis.com] on project [<projectid>]…Operation “operations/acat.p2-<projectid>-<uuid>” finished successfully.Created an external account key[b64MacKey: <hmac_key>keyId: <keyid>]保存好输出的<hmac_key>和<keyid>,接下来要用安装acme.shcurl https://get.acme.sh | sh -s # 请确保已安装 curl显示Install success!即为安装成功使用凭据注册acme.sh –set-default-ca –server google #切换默认 CA 为 Googleacme.sh –server https://dv.acme-v02.api.pki.goog/directory \–register-account –accountemail <Your_Email> –eab-kid <keyid> –eab-hmac-key <hmac_key> # 使用刚刚获取凭据注册账号签发证书使用 TXT 记录手动验证 DNSacme.sh –issue –dns -d yourdomain.com \–yes-I-know-dns-manual-mode-enough-go-ahead-please然后根据回显中Add the following TXT record:Domain: ‘_acme-challenge.yourdomain.com’TXT value: ‘<TXT_value>’设置 DNS 记录,完成后输入acme.sh –renew -d yourdomain.com \–yes-I-know-dns-manual-mode-enough-go-ahead-please完成证书申请显示Cert success即为申请成功可以在~/.acme.sh/yourdomain.com/下获取证书使用 Cloudflare API 自动验证 DNS(注:这里默认使用了 Cloudflare 来演示自动申请证书,详细的支持列表及申请方法可以在这里找到)首先获取你的Global API Key,可在此处获取然后在终端中输入export CF_Key='<YourGlobalAPIKey>’export CF_Email=”<YourEmail>”接下来申请证书,输入acme.sh –issue –dns dns_cf -d yourdomain.com #单域名acme.sh –issue –dns dns_cf -d *.yourdomain.com #泛域名acme.sh –issue –dns dns_cf -d sub1.yourdomain.com -d sub2.yourdomain.com #多域名acme.sh –issue –dns dns_cf -d yourdomain.com –ecc #ECC 证书看到回显Cert success即为申请成功,可以在~/.acme.sh/yourdomain.com/下获取证书此时 Cloudflare 凭据会自动存储至~/.acme.sh/account.conf用于续期目的