全站HTTPS时代,加固网站通信安全

banner.jpg

下载 Certbot 客户端
wget https://dl.eff.org/certbot-auto

设为可执行权限
chmod a+x certbot-auto

1. 申请通配符证书,只能使用 dns-01 的方式。*.xxx.com 请根据自己的域名自行更改

./certbot-auto certonly -d "*.xxx.com" --manual --preferred-challenges dns-01 --server https://acme-v02.api.letsencrypt.org/directory

https-01.png

https-02.png

配置好后再稍等几秒【等待dns 生效】再继续, 就会看到 Congratulations! 证书生成成功!

2. 通过 http-01 方式验证,域名如未备案,可以到日本或美国 等服务器上生成证书,再拷贝回来

mkdir  /home/website
location   /.well-known/acme-challenge/ {
    root /home/website;
    allow all;
}

启动nginx,监听 80 端口
为域名生成证书,可同时为多个域名 申请证书,只需在后面加上多个 -d 域名 即可
./certbot-auto certonly --webroot -w /home/website -d your.domain

你可能感兴趣的:(全站HTTPS时代,加固网站通信安全)