acme.sh申请SSL证书

2021-10-26 宋洋葱 宋洋葱 1 min

申请证书

参考 acme 的说明,先登录阿里云帐户以获取的 API 密钥在(配置一个 accesskey)

然后到需要部署整书的服务器执行命令:

export Ali_Key="sdfsdfsdfljlbjkljlkjsdfoiwje"
export Ali_Secret="jlsdflanljkljlfdsaklkjflsa"
acme.sh --issue --dns dns_ali -d songxueyan.top -d *.songxueyan.top

大概两分钟所有就可以生成, Ali_Key 和 Ali_Secret 将被保存在 ~/.acme.sh/account.conf

[2021年 10月 26日 星期二 21:29:33 CST] Your cert is in: /root/.acme.sh/songxueyan.top/songxueyan.top.cer
[2021年 10月 26日 星期二 21:29:33 CST] Your cert key is in: /root/.acme.sh/songxueyan.top/songxueyan.top.key
[2021年 10月 26日 星期二 21:29:33 CST] The intermediate CA cert is in: /root/.acme.sh/songxueyan.top/ca.cer
[2021年 10月 26日 星期二 21:29:33 CST] And the full chain certs is there: /root/.acme.sh/songxueyan.top/fullchain.cer

部署证书

即把整书拷贝到相应目录。

acme.sh --installcert  -d songxueyan.top -d *.songxueyan.top  \
        --key-file   /etc/nginx/ssl/sxytop.key \
        --fullchain-file /etc/nginx/ssl/sxytop.cer 

Leave a Comment

Your email address will not be published. Required fields are marked *