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 添加到定时任务,定期检查证书是否过期。

相关推荐
游戏开发爱好者86 小时前
iOS 推送怎么配置,APNs 推送证书、设备库与群发
android·ios·小程序·https·uni-app·iphone·webview
zhengqiqiqinqin7 小时前
Ubuntu16.04 升级ssl到3.5.7、升级ssh到9.8p1
网络协议·ssh·ssl
蜡台1 天前
本机 局域网 搭建本地 HTTPS 域名完整方案
网络协议·http·https·openssl
Alkaid20771 天前
为什么查 IP 有两个结果?这个问题问倒过多少人
网络协议·tcp/ip
LCG元1 天前
ESP32-IDF 远程固件升级实战:HTTPS OTA + 双分区切换 + 自动回滚
数据库·redis·https
檀越剑指大厂1 天前
CentOS部署Landlord斗地主项目:源码编译并实现远程访问
linux·运维·centos
严谨的麻辣烫2 天前
数据中心出口与住宅出口的技术差异:从 ASN 到 TCP 行为的一次拆解
网络·网络协议·tcp/ip
2501_915921432 天前
appuploader-cli 命令行上传 IPA 到 App Store Connect upload CI 集成
android·ci/cd·小程序·https·uni-app·iphone·webview
2501_915921432 天前
抓包鹰 Traceeagle 解除证书绑定,SSL Pinning 解除
网络·网络协议·网络安全·ios·adb·https·ssl
Lucky_Turtle2 天前
【SSL】letsencrypt域名证书申请,Cloudflare域名
网络·网络协议·ssl