https证书怎么申请

发布时间:2021-09-14 18:13 来源:亿速云 阅读:0 作者:chen 栏目: 服务器 欢迎投稿:712375056

这篇文章主要讲解了“httpsssl/' target='_blank'>证书怎么申请”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“https证书怎么申请”吧!

下面介绍两种比较简单的申请方式:
使用网站
    https://freessl.cn/   在线免费申请有效期为一年的证书。     

    **获取certbot客户端**
wget https://dl.eff.org/certbot-auto
chmod a+x certbot-auto

**停止nginx/apache**
systemctl stop nginx

**生成证书**
./certbot-auto certonly --standalone --email `你的邮箱地址` -d `你的域名地址`
当前网站有多个域名时需在后面增加,例如:
./certbot-auto certonly --standalone --email `你的邮箱地址` -d `你的域名1` -d `你的域名2`

**查看生产的证书**
tree /etc/letsencrypt/live/
**将证书用于nginx**
 添加到server 字段下
    listen 443 ssl http2;
    server_name domain_name;
    root /usr/share/nginx/html;
    ssl_certificate   /etc/letsencrypt/live/domain_name/fullchain.pem;
    ssl_certificate_key  /etc/letsencrypt/live/domain_name/privkey.pem;
    ssl_session_timeout 5m;
    ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_prefer_server_ciphers on;
**目前已经配置好https了,下面进行自动续期操作**
将下面内容添加到任务计划就可以自动续期了。
0 0,12 * * * python -c 'import random; import time; time.sleep(random.random() * 3600)'      && certbot renew
**启动nginx/apache**
 systemctl start nginx

免责声明:本站发布的内容(图片、视频和文字)以原创、来自本网站内容采集于网络互联网转载等其它媒体和分享为主,内容观点不代表本网站立场,如侵犯了原作者的版权,请告知一经查实,将立刻删除涉嫌侵权内容,联系我们QQ:712375056,同时欢迎投稿传递力量。