< 自用文儿 > CertBot 申请 SSL 证书 使用 challenge 模式 避开防火墙的阻挡

环境:

腾讯 VPS

腾讯会向你销售 SSL , 这个本是免费的。CertBot 默认申请证书要用到 80 端口,会蹭边什么什么条款,备案法律来阻止80端口的通讯,没有网站也一样被阻拦。

通过腾讯买的域名:bestherbs.cn

DNS 基础服务没有单独收费,奇迹。 还是把 DNS 移到 cloudflare 来管理。

展示用于出售的有机培育的鲜活 "香料植物"

获得 SSL 证书方法

1. 分配 DNS 记录 (第一次: A 记录)

要创建 2个 DNS 记录: A TXT

A 记录: i.bestherbs.cn

不要使用 CloudFlare DNS 代理,让云朵是:灰色

2. 安装 certbot

复制代码
apt udate
sudo apt install certbot python3-certbot-nginx -y

3. Challenge 方法获取证书

1) 确认新建 A 记录生效

复制代码
dig i.daven.us +short

2) 执行证书申请命令

复制代码
sudo certbot certonly --manual --preferred-challenges dns -d i.bestherbs.cn

这时不要按"回车" , 根据提示创建 TXT 记录

3)创建 TXT DNS 记录: _acme-challenge.i.bestherbs.cn.

使用红框中的值:VdwdeGvHXAx-4IHV4mMQfrq3RYuPCa0zfZZ8_2WNLvk

不要使用 CloudFlare DNS 代理,让云朵是:灰色

4) 等待几分钟 DNS 记录生效

查询 DNS 记录:

复制代码
while true; do dig _acme-challenge.i.bestherbs.cn TXT +short; date; sleep 2; done

等待 ...

直到看到返回:

4)继续 1 的任务: 按 "回车"

完成

证书是 3 个月一更换,上面已经告知: 重复操作即可。

TIP ( 提示):

CertBot 是临时占用 80,或者 443 端口,我用的是 Nginx 来提供 WEB 服务,临时用不存在的网站。

复制代码
server {
    listen 80;
    server_name practice;
    
    # Root directory for website files
    root /var/www/practice;
    index index.html;
    
    # Let's Encrypt verification path
    location /.well-known/acme-challenge/ {
        root /var/www/letsencrypt;
        allow all;
    }
    
    # Basic configuration
    location / {
        try_files $uri $uri/ =404;
    }
    
    # Log files
    access_log /var/log/nginx/practice.log;
    error_log /var/log/nginx/practice.log;
}

如果是正式网站,把上面 Practice 替换为你的 FQDN 就行,CertBot 会修改 Nginx 配置去添加证书到网络配置文件中,少些操作。

测试: https://i.bestherbs.cn:8443/

Grok 2 , image creation is unavailable by Xai. everything input will be record as a training data that will be collected by Xai.

相关推荐
2501_915921435 小时前
Charles 抓包 HTTPS 原理详解,从 CONNECT 到 SSL Proxying、常见问题与真机调试实战(含 Sniffmaster 补充方案)
android·网络协议·小程序·https·uni-app·iphone·ssl
whltaoin6 小时前
SpringCloud项目阶段五:openFeign服务接入以及接入腾讯云内容安全服务实现文章提交违规信息自动审核
spring cloud·腾讯云·openfeign·内容安全
uesowys6 小时前
腾讯云容器服务
腾讯云·容器服务
Clownseven6 小时前
忘记云服务器密码怎么办?阿里云/腾讯云/AWS密码重置官方指南
服务器·阿里云·腾讯云
@Ryan Ding6 小时前
阿里云与腾讯云产品操作与体验:云平台运维实战技术解析
阿里云·云计算·负载均衡·腾讯云·cdn
2501_915918412 天前
HTTPS 请求抓包实战,从请求捕获到解密分析的逐步流程与工具组合(https 请求抓包、iOS 真机、SSL Pinning 排查)
android·ios·小程序·https·uni-app·iphone·ssl
2024暴富2 天前
Http升级Https使用Certbot申请证书并免费续期
http·阿里云·https·ssl
Clownseven2 天前
宝塔面板搭建RustDesk教程:告别命令行,一键拥有私有远程桌面
docker·腾讯云
不努力谁会可怜你?2 天前
HTTPS报文在SSL/TLS证书安全隧道传输的原理
网络协议·https·stl·ssl·tls
游戏开发爱好者82 天前
iPhone HTTPS 抓包实战,原理、常见工具、SSL Pinning 问题与替代工具的解决方案
android·ios·小程序·https·uni-app·iphone·ssl