6

使用命令行保存网站的ssl证书

 2 years ago
source link: https://blog.kelu.org/tech/2022/04/07/linux-command-save-ssl-certificate-locally.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

使用命令行保存网站的ssl证书

2022-04-07     tech linux

linux.jpg

使用命令行,发现 curl 某个请求时报错:

ERROR: The certificate of ‘xxx’ is not trusted.
ERROR: The certificate of ‘xxx’ has expired.

这就奇怪了,只在某个服务器上才有问题,其他服务器又没有问题。遂把证书抓下来看看啥情况。

openssl s_client -connect {HOSTNAME}:{PORT} -showcerts

# 例如:
openssl s_client -connect blog.kelu.org:443 -showcerts

即可下载证书。

另外如果 curl 可以使用 -k 跳过证书验证。


如果本文对你有帮助,欢迎投食

alipay.gif
qpay.gif
圣杯の寄るべに従い。この意、この理に従うならば応えよ!

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK