惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Stack Overflow Blog
Stack Overflow Blog
PCI Perspectives
PCI Perspectives
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
V2EX - 技术
V2EX - 技术
Google DeepMind News
Google DeepMind News
量子位
博客园_首页
S
SegmentFault 最新的问题
S
Secure Thoughts
F
Full Disclosure
H
Hacker News: Front Page
博客园 - 三生石上(FineUI控件)
U
Unit 42
H
Heimdal Security Blog
N
News and Events Feed by Topic
A
About on SuperTechFans
C
CERT Recently Published Vulnerability Notes
Cyberwarzone
Cyberwarzone
Help Net Security
Help Net Security
The Hacker News
The Hacker News
L
LINUX DO - 最新话题
Application and Cybersecurity Blog
Application and Cybersecurity Blog
罗磊的独立博客
N
News | PayPal Newsroom
Spread Privacy
Spread Privacy
C
Cisco Blogs
C
CXSECURITY Database RSS Feed - CXSecurity.com
云风的 BLOG
云风的 BLOG
A
Arctic Wolf
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Simon Willison's Weblog
Simon Willison's Weblog
B
Blog
人人都是产品经理
人人都是产品经理
TaoSecurity Blog
TaoSecurity Blog
博客园 - 【当耐特】
C
Cyber Attacks, Cyber Crime and Cyber Security
P
Proofpoint News Feed
Hugging Face - Blog
Hugging Face - Blog
I
InfoQ
D
DataBreaches.Net
大猫的无限游戏
大猫的无限游戏
Apple Machine Learning Research
Apple Machine Learning Research
L
LINUX DO - 热门话题
Google Online Security Blog
Google Online Security Blog
V
Visual Studio Blog
V
Vulnerabilities – Threatpost
Know Your Adversary
Know Your Adversary
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
B
Blog RSS Feed

🤪C'est la vie

自建 Tailscale 的 DERP Server 优雅地使用 Python requests 调用 Aria2 JSON-RPC 版权声明 关于 Hello Hugo——记Hugo博客搭建 友链
使用 ACME.SH 申请 Google CA SSL 证书
Jonathan Zhang · 2023-01-01 · via 🤪C'est la vie

前言

最近谷歌开放了自家的 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-01HTTP-01、和 DNS-01

  • 暂不支持邮箱验证方式申请

  • 暂不支持国际化域名编码的域名

申请步骤

获取注册密钥

打开shell.cloud.google.com,输入以下代码

$ gcloud beta publicca external-account-keys create #创建凭据

回显为

$ gcloud beta publicca external-account-keys create
API [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 API
Enabling 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.sh

$ curl  https://get.acme.sh | sh -s   # 请确保已安装 curl

显示Install success!即为安装成功

使用凭据注册

$ acme.sh --set-default-ca --server google #切换默认 CA 为 Google
$ acme.sh --server https://dv.acme-v02.api.pki.goog/directory \
--register-account  --accountemail <Your_Email> --eab-kid <keyid> --eab-hmac-key <hmac_key> # 使用刚刚获取凭据注册账号

签发证书

  1. 使用 TXT 记录手动验证 DNS
$ acme.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/下获取证书

  1. 使用 Cloudflare API 自动验证 DNS1

首先获取你的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用于续期目的

附:申请下的证书路径

文中部分信息已做脱敏处理


参考文献

  1. acme.sh Wiki - github.com

  2. Automate Public Certificates Lifecycle Management via RFC 8555 (ACME) - google.com