certbot 官網地址:https://certbot.eff.org/
1、通過certbot 工具制作https協(xié)議訪問,是通過http訪問轉發(fā)到https,首先就要在centos的nginx配置文件中配置
如圖:

2、配置centos環(huán)境安裝certbot工具
(1)yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
(2)yum -y install yum-utils
yum-config-manager --enable rhui-REGION-rhel-server-extras rhui-REGION-rhel-server-optional
(3)sudo yum install certbot python2-certbot-nginx
(4)啟動:sudo certbot --nginx? (根據啟動進行操作選擇)
啟動報錯:

解決錯誤:
(1)卸載依賴包:pip uninstall urllib3
(2)重裝依賴包:pip install --upgrade --force-reinstall 'requests==2.6.0' urllib3

? ? (3)啟動失?。篹asy_install urllib3==1.21.1
重裝可能會失敗,不斷嘗試就可以了
按照步驟一步一步往下走:



最后,使用linux的定時任務,進行續(xù)期!
新建文件夾:

vim?task.crontab
vim編輯:0 23 * * 6 /usr/bin/certbot renew --force-renewal >> /var/log/certbot-renew.log? ? 定義每周六晚上23點整自動更新一次!
定時任務查看:crontab -l
刪除:crontab -r
啟動:crontab /etc/cron.d/task.crontab
#手動測試,
查看證書過期時間
v
#忽略證書過期時間,直接重置證書時間
certbot renew --force-renewal
#定時任務
crontab -e?
#編輯文件
0 0 1 * * /usr/bin/certbot renew --force-renewal
某些錯誤:

通配符配置參考:
certbot certonly --manual -d '*.huizhaobiao.net.cn' --server https://acme-v02.api.letsencrypt.org/directory
http://www.itdecent.cn/p/1eb7060c5ede
其次:https://developer.aliyun.com/article/568689?spm=a2c6h.13813017.0.dArticle738638.3e0f27ffH2E6WC