brew 安装失败:curl(77) 设置证书验证时出错

2024-02-08

好的,我正在运行带有自制软件的旧 Mac 10.6.8。 brew doctor 报告没有错误,我已经尝试过brew prune update 等。每次我尝试安装软件包时,都会收到此错误:

curl: (77) error setting certificate verify locations:
CAfile: /etc/ssl/certs/ca-certificates.crt
CApath: /usr/local/etc/openssl/certs

我尝试了所有方法,openssl 已安装,但提到的文件夹

/usr/local/etc/openssl/certs

/etc/ssl/certs/ca-certificates.crt

不在这里。谁能救我吗?

完整样本:

jonathan-fullers-iMac% brew install git 
Updating Homebrew...
==> Installing dependencies for git: xz
==> Installing git dependency: xz
==> Downloading https://downloads.sourceforge.net/project/lzmautils/xz-5.2.3.tar

curl: (77) error setting certificate verify locations:
CAfile: /etc/ssl/certs/ca-certificates.crt
CApath: /usr/local/etc/openssl/certs
Trying a mirror...
==> Downloading https://tukaani.org/xz/xz-5.2.3.tar.gz

curl: (77) error setting certificate verify locations:
CAfile: /etc/ssl/certs/ca-certificates.crt
CApath: /usr/local/etc/openssl/certs
Error: Failed to download resource "xz"
Download failed: https://tukaani.org/xz/xz-5.2.3.tar.gz

酿造医生报告:

jonathan-fullers-iMac% brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry and just ignore them. Thanks!

Warning: You are using macOS 10.6.
We (and Apple) do not provide support for this old version.
You may encounter build failures or other breakages.
Please create pull-requests instead of filing issues.

Edit

发现一个杂散的.curlrc文件,将其删除,现在错误更改为:

jonathan-fullers-iMac% curl https://github.com
curl: (77) error setting certificate verify locations:
CAfile: /usr/local/etc/openssl/cert.pem
CApath: /usr/local/etc/openssl/certs

但 PEM 文件在那里......:

jonathan-fullers-iMac% pwd && echo "\r\n" && ls
/usr/local/etc/openssl
cert.pem    certs       misc        openssl.cnf private

这是我的路径,以防万一:

jonathan-fullers-iMac% echo $PATH
/Users/werlious/.bin:
/usr/local/bin:
/usr/local/opt/curl/bin:
/usr/bin:
/bin:
/usr/sbin:
/sbin:
/usr/local/bin:
/usr/X11/bin

另一个编辑我尝试重新安装 openssl,安装没有给我错误,但卸载给了我:

jonathan-fullers-iMac% brew uninstall --ignore-dependencies openssl && brew install openssl
Uninstalling /usr/local/Cellar/openssl/1.0.2l... (1,701 files, 12.7MB)
dyld: Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
  Referenced from: /usr/local/opt/curl/bin/curl
  Reason: image not found
dyld: Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
  Referenced from: /usr/local/opt/curl/bin/curl
  Reason: image not found
dyld: Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
  Referenced from: /usr/local/opt/curl/bin/curl
  Reason: image not found
dyld: Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
  Referenced from: /usr/local/opt/curl/bin/curl
  Reason: image not found
dyld: Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
  Referenced from: /usr/local/opt/curl/bin/curl
  Reason: image not found
dyld: Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
  Referenced from: /usr/local/opt/curl/bin/curl
  Reason: image not found
Updating Homebrew...
dyld: Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
  Referenced from: /usr/local/opt/curl/bin/curl
  Reason: image not found
dyld: Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
  Referenced from: /usr/local/opt/curl/bin/curl
  Reason: image not found

另一个更新所以安装 openssl 后,我现在有这个:

jonathan-fullers-iMac% brew install python
Updating Homebrew...
==> Installing dependencies for python: readline, sqlite, gdbm
==> Installing python dependency: readline
==> Downloading https://ftp.gnu.org/gnu/readline/readline-7.0.tar.gz
  curl: (77) error setting certificate verify locations:
   CAfile: /usr/local/etc/openssl/cert.pem
   CApath: /usr/local/etc/openssl/certs
Trying a mirror... 
==> Downloading https://ftpmirror.gnu.org/readline/readline-7.0.tar.gz
==> Downloading from http://mirrors.ibiblio.org/gnu/ftp/gnu/readline/readline-7.
######################################################################## 100.0%
==> Downloading https://ftp.gnu.org/gnu/readline/readline-7.0-patches/readline70

curl: (77) error setting certificate verify locations:
  CAfile: /usr/local/etc/openssl/cert.pem
  CApath: /usr/local/etc/openssl/certs
Trying a mirror...
==> Downloading https://ftpmirror.gnu.org/readline/readline-7.0-patches/readline
==> Downloading from http://mirror.easthsia.com/gnu/readline/readline-7.0-patche
######################################################################## 100.0%
==> Downloading https://ftp.gnu.org/gnu/readline/readline-7.0-patches/readline70

curl: (77) error setting certificate verify locations:
  CAfile: /usr/local/etc/openssl/cert.pem
  CApath: /usr/local/etc/openssl/certs
Trying a mirror... 
==> Downloading https://ftpmirror.gnu.org/readline/readline-7.0-patches/readline
==> Downloading from http://mirrors.ibiblio.org/gnu/ftp/gnu/readline/readline-7.
######################################################################## 100.0%
==> Downloading https://ftp.gnu.org/gnu/readline/readline-7.0-patches/readline70

curl: (77) error setting certificate verify locations:
  CAfile: /usr/local/etc/openssl/cert.pem
  CApath: /usr/local/etc/openssl/certs
Trying a mirror...
==> Downloading https://ftpmirror.gnu.org/readline/readline-7.0-patches/readline
==> Downloading from http://mirror.us-midwest-1.nexcess.net/gnu/readline/readlin
 ######################################################################## 100.0%
 ==> Patching
==> Applying readline70-001
patching file history.c
patching file patchlevel  
==> Applying readline70-002
patching file history.c
patching file patchlevel
==> Applying readline70-003
patching file input.c
patching file patchlevel
==> ./configure --prefix=/usr/local/Cellar/readline/7.0.3_1
==> make install
==> Caveats
This formula is keg-only, which means it was not symlinked into /usr/local,
because macOS provides the BSD libedit library, which shadows libreadline.
In order to prevent conflicts when programs look for libreadline we are
defaulting this GNU Readline installation to keg-only..
For compilers to find this software you may need to set:
   LDFLAGS:  -L/usr/local/opt/readline/lib
   CPPFLAGS: -I/usr/local/opt/readline/include

==> Summary
/usr/local/Cellar/readline/7.0.3_1: 46 files, 1.5MB, built in 3 minutes 6 seconds
==> Installing python dependency: sqlite
==> Downloading https://sqlite.org/2017/sqlite-autoconf-3200000.tar.gz

curl: (77) error setting certificate verify locations:
  CAfile: /usr/local/etc/openssl/cert.pem
  CApath: /usr/local/etc/openssl/certs
Error: Failed to download resource "sqlite"
Download failed: https://sqlite.org/2017/sqlite-autoconf-3200000.tar.gz

我很失落。我不知道现在发生了什么


此错误消息表明curl 无法使用openssl 建立安全连接 你可以:

first

echo insecure >> ~/.curlrc
git config --global http.sslVerify false

然后重新安装openssl和curl

HOMEBREW_CURLRC=1 brew reinstall openssl curl

last

sed -i '/^insecure$/d' ~/.curlrc
git config --global http.sslVerify true
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

brew 安装失败:curl(77) 设置证书验证时出错 的相关文章

随机推荐