使用 acmesh 签发证书
安装
curl https://get.acme.sh | sh -s email=my@example.com # 注意自己替换邮箱,可以随便输入
source ~/.bashrc国内服务器安装:
git clone https://gitee.com/neilpang/acme.sh.git
cd acme.sh
./acme.sh --install -m my@example.com开启自动更新
acme.sh --upgrade --auto-upgrade手动切换 SSL CA
切换 Let’s Encrypt
acme.sh --set-default-ca --server letsencrypt生成证书
如果你用的 apache服务器
acme.sh --issue -d mydomain.com --apache如果你用的 nginx服务器
acme.sh --issue -d mydomain.com --nginx如果你还没有运行任何 web 服务, 80 端口是空闲的, 那么 acme.sh 还能假装自己是一个webserver, 临时听在80 端口, 完成验证
acme.sh --issue -d mydomain.com --standalone如果你不是标准的 80 端口,可以执行端口
acme.sh --issue -d mydomain.com --standalone --httpport 88运行成功后会生成如下文件:
mydomain.com.cer # 域名的公钥 Certificate File
mydomain.com.key # 域名的私钥 Private Key File (切勿泄露私钥)
ca.cer # 中间 CA 证书 Intermediate CA Certificate 中间 CA 证书是将您的证书(为您的域签发的证书)与 CA 根证书连接起来的证书
fullchain.cer # 全链证书 Full Chain Certificates 包含域名证书和中间 CA 证书的组合本文参考:
acme 中文说明
Install in China
How to issue a cert
acme.sh手动切换SSL CA
评论已关闭