惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

云风的 BLOG
云风的 BLOG
The GitHub Blog
The GitHub Blog
Y
Y Combinator Blog
博客园 - 三生石上(FineUI控件)
T
The Blog of Author Tim Ferriss
宝玉的分享
宝玉的分享
Hugging Face - Blog
Hugging Face - Blog
WordPress大学
WordPress大学
V
Visual Studio Blog
小众软件
小众软件
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
MongoDB | Blog
MongoDB | Blog
V
V2EX
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 【当耐特】
Microsoft Azure Blog
Microsoft Azure Blog
The Cloudflare Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Engineering at Meta
Engineering at Meta
L
LangChain Blog
Martin Fowler
Martin Fowler
GbyAI
GbyAI
博客园 - 司徒正美

Jiajun的技术笔记

你好,2026! TiDB 源码阅读(六):TiDB Coprocessor 源码解析 性能优化的核心思想 TiDB 源码阅读(五):索引 TiDB 源码阅读(四):AST、逻辑计划、物理计划 CockroachDB Serverless Architecture podman 无故退出 Cursor Control-L (CTRL-L) Keyboard Shortcuts in Terminal Replace docker with podman Using xmonad with xfce4 A RC script for freebsd frpc 自己动手写一个k8s controller AI 会取代你的(编程)岗位吗? 自建DERP服务器提升Tailscale连接速度(使用Nginx转发) 自动升级Docker容器 再读《程序员修炼之道-从小工到专家》 让浏览器下载文件 再读《软件随想录》/《黑客与画家》/《软技能》 HTTP 压力测试中的 Coordinated Omission 2的补码 编程语言中的 context 是什么? flutter macOS 构建出错 Flatpak 使用小记 Golang CAS 操作是怎么实现的 PostgreSQL 当MQ来使用 Clash 结合 工作VPN 的网络设计 使用 PostgreSQL 搭建 JuiceFS PostgreSQL 配置优化和日志分析 有GitHub Copilot?那就可以搭建你的ChatGPT4服务 窗口函数的使用(以PG为例)
修复Linux下curl等无法使用letsencrypt证书
Jiajun Huang · 2019-11-26 · via Jiajun的技术笔记

遇到一个奇怪的问题,由于我的博客使用的是letsencrypt,浏览器可以正常访问,但是命令行却不可以。

$ curl https://git.jiajunhuang.com
curl: (60) SSL certificate problem: unable to get local issuer certificate
More details here: https://curl.haxx.se/docs/sslcerts.html

curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.

除了curl,git和wget等也不可以用,这就很奇怪了,为什么浏览器可以但是命令行却不可以呢?

原因是Nginx配置中,ssl_certificate 我之前指向的是生成的中间的 crt 文件而不是最后的 chained certificate。 Nginx官方文档给出的方案是:

不过我们不必这么做,此处仅作阅读

$ cat www.example.com.crt bundle.crt > www.example.com.chained.crt

我们不必这么做,因为无论是 certbot 还是 acme.sh 都会帮我们处理好。把 ssl_certificate 的路径改成证书所在路径, 名称改为 fullchain.crt 即可。

例如:

ssl_certificate /etc/acme.sh/jiajunhuang.com/fullchain.cer;

这下大功告成:

$ curl -I https://jiajunhuang.com
HTTP/2 302 
server: nginx/1.14.2
date: Tue, 26 Nov 2019 15:07:03 GMT
content-type: text/html; charset=utf-8
location: /404


参考资料: