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

推荐订阅源

D
Docker
爱范儿
爱范儿
T
The Exploit Database - CXSecurity.com
量子位
T
Tailwind CSS Blog
T
Threatpost
The GitHub Blog
The GitHub Blog
AWS News Blog
AWS News Blog
云风的 BLOG
云风的 BLOG
K
Kaspersky official blog
P
Proofpoint News Feed
博客园 - 司徒正美
L
LangChain Blog
T
Threat Research - Cisco Blogs
C
CERT Recently Published Vulnerability Notes
罗磊的独立博客
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 叶小钗
S
Secure Thoughts
The Last Watchdog
The Last Watchdog
Spread Privacy
Spread Privacy
H
Hacker News: Front Page
T
Troy Hunt's Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Google DeepMind News
Google DeepMind News
W
WeLiveSecurity
A
Arctic Wolf
Apple Machine Learning Research
Apple Machine Learning Research
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
P
Proofpoint News Feed
T
Tor Project blog
T
The Blog of Author Tim Ferriss
I
Intezer
P
Privacy & Cybersecurity Law Blog
美团技术团队
N
Netflix TechBlog - Medium
博客园_首页
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
V
Vulnerabilities – Threatpost
Application and Cybersecurity Blog
Application and Cybersecurity Blog
G
Google Developers Blog
Attack and Defense Labs
Attack and Defense Labs
T
Tenable Blog
月光博客
月光博客
Stack Overflow Blog
Stack Overflow Blog
J
Java Code Geeks
腾讯CDC
Microsoft Security Blog
Microsoft Security Blog
A
About on SuperTechFans
Last Week in AI
Last Week in AI

🤪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