首页 > Windows开发 > 详细

certbot 调用cloudflare api申请证书

时间:2020-10-03 09:37:38      阅读:172      评论:0      收藏:0      [点我收藏+]

certbot 调用cloudflare api申请证书

1.安装certbot

sudo yum install certbot python2-certbot-nginx -y

2.安装插件

sudo yum -y install python-pip
pip install --upgrade pip
pip install certbot-dns-cloudflare

3.创建存储API调用凭证的目录

mkdir -p ~/.secrets/certbot

chmod 0700 ~/.secrets

# Cloudflare API 秘钥
vim ~/.secrets/certbot/cloudflare.ini 
dns_cloudflare_email = xxxxxx@gmail.com
dns_cloudflare_api_key = xxxxxxxxxxxxxxxxxxxxxxxxxxxx

# 修改文件权限
chmod 0400 ~/.secrets/certbot/cloudflare.ini

4.申请证书

[root@ ~] certbot certonly -d ‘xxx.com, *.xxx.com, yyy.com, *.yyy.com, zzz.com, *.zzz.com‘     --agree-tos     --email xxxxxx@gmail.com     --server https://acme-v02.api.letsencrypt.org/directory     --dns-cloudflare     --dns-cloudflare-credentials ~/.secrets/certbot/cloudflare.ini     --dns-cloudflare-propagation-seconds 100

#注意:最多添加100个域名。
#域名较多时等待的时间较久,耐心等待。
#域名不多时 --dns-cloudflare-propagation-seconds 100 可以设置小一点,这里时等待100秒
#执行完之后,会输出证书的位置默认位置在 /etc/letsencrypt/live/ 下面。证书生成完之后,记得创建一个文件,记录下该证书属于那些域名防止以后忘记了。例如一下:
[root@]# pwd
/etc/letsencrypt/archive/xxx.com
[root@]# ls
cert1.pem  chain1.pem  domain.txt  fullchain1.pem  privkey1.pem
[root@zuanshi-pre-web01 wx3311.com]# cat domain.txt 
xxx.com, *.xxx.com, yyy.com, *.yyy.com, zzz.com, *.zzz.com

certbot 调用cloudflare api申请证书

原文:https://www.cnblogs.com/carry00/p/13763435.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!