申请免费SSL证书

2019-05-14  本文已影响0人  辛多雷

准备

centos 7.4
Let's Encrypt certbot-auto

部署certbot-auto

wget https://dl.eff.org/certbot-auto
chmod a+x certbot-auto
mv certbot-auto /usr/local/bin/

手动创建证书

这里的domainname可以是 *.domain.com也可以是 aa.domain.com

certbot-auto certonly -d 'domainname' --manual --preferred-challenges dns-01 --server https://acme-v02.api.letsencrypt.org/directory

第一次运行需要填写域名到期的通知地地址

Enter email address (used for urgent renewal and security notices) (Enter 'c' to
cancel): email@qq.com

开始创建证书:

-------------------------------------------------------------------------------
(A)gree/(C)ancel: A
-------------------------------------------------------------------------------
(Y)es/(N)o: N
-------------------------------------------------------------------------------
Are you OK with your IP being logged?
(Y)es/(N)o: Y
-------------------------------------------------------------------------------
Please deploy a DNS TXT record under the name
_acme-challenge.domainname.com with the following value:

FTctTRfyr6zmfwtI7Gcv7Omgj5Jf202UgCJ-NIX3GtE

Before continuing, verify the record is deployed.
-------------------------------------------------------------------------------
Press Enter to Continue
ls /etc/letsencrypt/live/{domainname}
cert.pem  chain.pem  fullchain.pem  privkey.pem  README

其中
fullchain.pem 重命名为{domainname}.pem
privkey.pem 重命名为{domainname}.key
这两个文件就可以给nginx作为证书了

challenge failed for domain

自动nginx

certbot-auto  --nginx
上一篇 下一篇

猜你喜欢

热点阅读