Bob's Blog

Web开发、测试框架、自动化平台、APP开发、机器学习等

返回上页首页

Homebrew安装包时提示curl的ssl证书过期问题的解决办法



今天在运行brew install wget时出现的问题,看到失败了觉得很奇怪,毕竟已经用brew install了不少东西了。

于是详细看了下错误提示,发现与curl和ssl certificate有关:curl: (60) SSL certificate problem: certificate has expired

curl: (60) SSL certificate problem: certificate has expired
More details here: https://curl.haxx.se/docs/sslcerts.html

curl performs SSL certificate verification by default, using a "bundle"
 of Certificate Authority (CA) public keys (CA certs). If the default
 bundle file isn't adequate, you can specify an alternate file
 using the --cacert option.
If this HTTPS server uses a certificate signed by a CA represented in
 the bundle, the certificate verification probably failed due to a
 problem with the certificate (it might be expired, or the name might
 not match the domain name in the URL).
If you'd like to turn off curl's verification of the certificate, use
 the -k (or --insecure) option.
HTTPS-proxy has similar options --proxy-cacert and --proxy-insecure.
Error: Failed to download resource "wget"

对于官方地址放到浏览器来是可以下载的:https://ftp.gnu.org/gnu/wget/wget-1.20.3.tar.gz

既然是证书过期,于是重新下载一份。用如下命令解决:

ls  -l /etc/ssl/cert.pem  
#先看看原证书是否存在和文件时间,发现是几年前的了
# -rw-r--r--  1 root  wheel  196928  3 21  2019 /etc/ssl/cert.pem
cp /etc/ssl/cert.pem /etc/ssl/cert.bak.pem
#这里做一个备份
curl -o ./cacert.pem "http://curl.haxx.se/ca/cacert.pem"  -L -v
#这里重新下载一份。但可是还是会报错,于是用浏览器下载到本地然后再移动到目录去
mv ~/Downloads/cacert.pem /etc/ssl/cert.pem

此时又能继续用brew install了。

下一篇:  google colab的一些使用限制
上一篇:  在artifactory上传和安装python包

共有0条评论

添加评论

暂无评论