Let‘s encrypt 免费 SSL 证书安装

Let's Encrypt 是一家免费、开放、自动化的证书颁发机构,由非营利组织互联网安全研究组(ISRG)运作。Let's encrypt 证书是 3 个月有效期,可以通过脚本自动续期。

shell 复制代码
yum install certbot -y

测试一下 Certbot 是否安装成功。

shell 复制代码
certbot --version

申请证书

shell 复制代码
certbot certonly --standalone -d 域名.com -d www.域名.com

--standalone 表示使用独立模式,不需要 Nginx 服务。--nginx 表示使用 Nginx 插件,-d 后面是域名,可以添加多个 -d 参数,支持多域名证书。申请证书之前,需要确保 Nginx 服务正常运行。

将证书链和私钥配置到 Nginx 服务器

nginx 复制代码
server {
    listen 443 ssl;
    server_name 域名.com www.域名.com;
    ssl_certificate  fullchain.pem;
    ssl_certificate_key /privkey.pem;
}

重启nginx

shell 复制代码
systemctl restart nginx

证书续期

Let's encrypt 证书是 3 个月有效期,可以通过 Certbot 自动续期。

shell 复制代码
certbot renew

Certbot 会检查证书是否过期,如果过期会自动续期。可以将 certbot renew 添加到定时任务,定期检查证书是否过期。

相关推荐
zfj3216 小时前
http请求完整的tcpdump抓包解读
网络协议·http·抓包·tcpdump
G31135422739 小时前
域名与IP:无限绑定的技术奥秘
网络·网络协议·tcp/ip
阿拉伯柠檬13 小时前
网络层协议IP(三)
linux·网络·网络协议·tcp/ip·面试
车载testing14 小时前
SOME/IP 进程生命周期
网络协议·tcp/ip
AI视觉网奇14 小时前
PixelStreamingInfrastructure https
https·livetalking
欧洵.14 小时前
HTTPS加密流程:从原理到关键要点拆解
网络协议·http·https
掘根15 小时前
【jsonRpc项目】RCP服务测试
qt·网络协议
2501_9160074715 小时前
跨平台 App 安全,Flutter、RN、Unity、H5 混合应用加固
android·ios·小程序·https·uni-app·iphone·webview
2401_8658548816 小时前
ssl免费证书与收费证书有什么区别
网络·网络协议·ssl
奋斗者1号16 小时前
SSL/TLS认证流程与CA证书字段详解
网络协议·iphone·ssl