显示页面修订记录反向链接回到顶部 本页面只读。您可以查看源文件,但不能更改它。如果您觉得这是系统错误,请联系管理员。 ===== ACME.SH 证书工具 ===== ACME 是一个使用纯 BASH SHELL 写的用于 Let's encrypt 等免费SSL证书的签发、续签工具 项目地址:[[https://github.com/acmesh-official/acme.sh|ACME.SH]] ==== ACME 安装 ==== <code> curl -k https://get.acme.sh | sh -s email=f.hsiaotien@gmail.com </code> ==== 安装 socat ==== 当作为独立服务器申请证书时,需要使用 socat 运行一个简易Web服务器 <code> yum install socat </code> ==== 重载 .bashrc ==== <code> . /root/.bashrc </code> ===== 签发证书 ===== 使用 CloudFlare APIKEY ==== 找到 Cloudflare 密钥 ==== <code> #CF_Token="" export CF_Zone_ID="xxxxxxxxx" #CF_Account_ID="xxxxxx" Multi-Domain export CF_Key="xxxxxxxx" export CF_Email="xxxxx@gmail.com" </code> 当为主域名或者泛域名申请证书时,需要使用 ''CF_KEY'' 和 ''CF_EMAIL'' 该数据非常重要,不能外泄,这两个数据可以在 Cloudflare 的 DNS 的控制台那里找到 ==== 签发证书 ==== <code>acme.sh --issue --dns dns_cf -d ovwx.org -d '*.ovwx.org'</code> ==== 刷新证书 ==== <code> $acmedir/acme.sh --cron --home $acmedir "/opt/.acme.sh"/acme.sh --cron --home "/opt/.acme.sh" </code> 在多台服务器上使用证书:需在一台服务器上签发了证书之后,将整个 ".acme.sh" 目录复制到新的服务器上,然后只需要也进行刷新就行了。 证书位置 <code> # Your cert is in: /root/.acme.sh/your_domain_ecc/subdomain.cer # Your cert key is in: /root/.acme.sh/your_domain_ecc/subdomain.key # The intermediate CA cert is in: ~/.acme.sh/your_domain_ecc/ca.cer # And the full chain certs is there: ~/.acme.sh/your_domain_ecc/fullchain.cer </code> ==== 移除证书 ==== <code>acme.sh --remove -d abc.ovwx.org --ecc</code> ==== 安装证书到特定目录 ==== <code> acme.sh --issue --dns dns_cf -d domain.com -d *.domain.com \ --installcert \ --key-file /etc/nginx/cert.d/domain.key \ --fullchain-file /etc/nginx/cert.d/domain.pem \ --reloadcmd "nginx -s reload" </code> ===== 查看证书信息 ===== 查看证书信息 <code>openssl x509 -noout -text -in server.crt</code> 查看Key信息 <code> openssl rsa -noout -text -in server.key openssl ec -noout -text -in server.key #针对EC密钥 </code> 查看证书请求信息 <code>openssl req -noout -text -in server.csr</code> itwiki/acme-cert.txt 最后更改: 2024/01/04 04:10由 ovwx@live.io