ACME 是一个使用纯 BASH SHELL 写的用于 Let's encrypt 等免费SSL证书的签发、续签工具
项目地址:ACME.SH
curl -k https://get.acme.sh | sh -s [email protected]
当作为独立服务器申请证书时,需要使用 socat 运行一个简易Web服务器
yum install socat
. /root/.bashrc
使用 CloudFlare APIKEY
#CF_Token="" export CF_Zone_ID="xxxxxxxxx" #CF_Account_ID="xxxxxx" Multi-Domain export CF_Key="xxxxxxxx" export CF_Email="[email protected]"
当为主域名或者泛域名申请证书时,需要使用 CF_KEY
和 CF_EMAIL
该数据非常重要,不能外泄,这两个数据可以在 Cloudflare 的 DNS 的控制台那里找到
acme.sh --issue --dns dns_cf -d ovwx.org -d '*.ovwx.org'
$acmedir/acme.sh --cron --home $acmedir "/opt/.acme.sh"/acme.sh --cron --home "/opt/.acme.sh"
在多台服务器上使用证书:需在一台服务器上签发了证书之后,将整个 “.acme.sh” 目录复制到新的服务器上,然后只需要也进行刷新就行了。
证书位置
# 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
acme.sh --remove -d abc.ovwx.org --ecc
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"
查看证书信息
openssl x509 -noout -text -in server.crt
查看Key信息
openssl rsa -noout -text -in server.key openssl ec -noout -text -in server.key #针对EC密钥
查看证书请求信息
openssl req -noout -text -in server.csr