0%

brew-insta

brew install 如何忽略证书错误

1
2
3
4
5
6
7
8
9
10
11
12
13
14
brew install timothyye/tap/glance                       7s xhs@xhsdeMac-mini 17:51:35
Running `brew update --auto-update`...
==> Fetching timothyye/tap/glance
Error: glance: Failed to download resource "glance"
Failure while executing; `/usr/bin/env /opt/homebrew/Library/Homebrew/shims/shared/curl --disable --cookie /dev/null --globoff --show-error --user-agent Homebrew/4.1.3\ \(Macintosh\;\ arm64\ Mac\ OS\ X\ 13.6.3\)\ curl/8.1.2 --header Accept-Language:\ en --retry 3 --fail --location --silent --head https://download.xiaozhou.xyz/glance-mac64-0.1.tar.gz` exited with 60. Here's the output:
curl: (60) SSL certificate problem: certificate has expired
More details here: https://curl.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.
HTTP/1.1 200 Connection established


ChatGPT
对于 Homebrew,通常情况下它会使用系统中的 curl 或者其他下载工具来下载软件包。因此,要让 Homebrew 忽略证书错误,你可以尝试在运行 brew install 命令之前设置相关的环境变量,让底层的下载工具忽略 SSL 证书验证。

你可以通过设置 HOMEBREW_CURLRC 环境变量来传递 curl 参数。在终端中执行以下命令:

bash
Copy code
export HOMEBREW_CURLRC=1
echo “-k” >> ~/.curlrc
这样做会将 -k 参数添加到 curl 的默认配置文件 ~/.curlrc 中,从而告诉 curl 忽略 SSL 证书验证。然后你再运行 brew install 命令时,Homebrew 应该会使用忽略证书错误的 curl 参数。

请注意,忽略 SSL 证书错误会降低安全性,只应该在调试或者特定情况下使用。