1.下载工具certbot-autopython
wget https://dl.eff.org/certbot-auto chmod +x certbot-auto
2.生成证书,默认会安装openssl-devel等依赖包api
# 须要root 权限 # 按照提示输入 邮箱地址,是否听从相关权益等操做 # 注:在提示域名解析后在敲回车操做部分 [root@BOSS_SUPPORT_ADP ~]# ./certbot-auto --server https://acme-v02.api.letsencrypt.org/directory -d "*.xxapp.com" --manual --preferred-challenges dns-01 certonly
3.若是一路回车错过域名解析部分会提示报错app
# 能够从新执行以上部操做 [root@BOSS_SUPPORT_ADP ~]# ./certbot-auto --server https://acme-v02.api.letsencrypt.org/directory -d "*.xxapp.com" --manual --preferred-challenges dns-01 certonly Saving debug log to /var/log/letsencrypt/letsencrypt.log Plugins selected: Authenticator manual, Installer None Obtaining a new certificate Performing the following challenges: dns-01 challenge for xxapp.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - NOTE: The IP of this machine will be publicly logged as having requested this certificate. If you're running certbot in manual mode on a machine that is not your server, please ensure you're okay with that. Are you OK with your IP being logged? - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - (Y)es/(N)o: Y ########### 输入 Y 以后,请勿敲回车 ########### 在域名解析商 作 TXT 解析 # _acme-chxxxxxxnge.xxapp.com TXT解析到 tvz7vfOMn9QT4XPxxxxxnvYygohV-scq72E0B_366s # 解析测试 dig _acme-chxxxxxxnge.xxapp.com txt # 成功后 敲回车 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Please deploy a DNS TXT record under the name _acme-challenge.xxapp.com with the following value: tvz7vfOMn9QT4XPxxxxxnvYygohV-scq72E0B_366s Before continuing, verify the record is deployed. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Press Enter to Continue Waiting for verification... Cleaning up challenges IMPORTANT NOTES: - Congratulations! Your certificate and chain have been saved at: /etc/letsencrypt/live/xxapp.com/fullchain.pem Your key file has been saved at: /etc/letsencrypt/live/xxapp.com/privkey.pem Your cert will expire on 2019-04-22. To obtain a new or tweaked version of this certificate in the future, simply run certbot-auto again. To non-interactively renew *all* of your certificates, run "certbot-auto renew" - If you like Certbot, please consider supporting our work by: Donating to ISRG / Let's Encrypt: https://letsencrypt.org/donate Donating to EFF: https://eff.org/donate-le
4.证书生成位置ide
# 下相应的域名 /etc/letsencrypt/live/
5.证书名称类型工具
-rw-r--r-- 1 root root 1907 Jan 22 03:07 cert1.pem # 证书正文 -rw-r--r-- 1 root root 1647 Jan 22 03:07 chain1.pem # -rw-r--r-- 1 root root 3554 Jan 22 03:07 fullchain1.pem # cert1.pem和chain1.pem 合并的证书 用于证书链 -rw------- 1 root root 1704 Jan 22 03:07 privkey1.pem # 证书秘钥 key
6.自动更新已申请的ssl证书测试
certbot 提供了更新证书的命令cerbot renew,会自动更新全部已申请的ssl证书。