簡體   English   中英

brew 安裝失敗:curl(77) 錯誤設置證書驗證

[英]brew install fails: curl(77) error setting certificate verify

好的,所以我正在運行帶有自制軟件的舊 Mac 10.6.8。 brew doctor 沒有報告任何錯誤,我已經嘗試過 brew prune update 等。每次我嘗試安裝 package 時,我都會收到此錯誤:

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.

編輯

找到一個stray.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 建立安全連接,您可以:

第一的

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

然后重新安裝 openssl 和 curl

HOMEBREW_CURLRC=1 brew reinstall openssl curl

最后的

sed -i '/^insecure$/d' ~/.curlrc
git config --global http.sslVerify true

我在這里找到了解決方案

轉到鑰匙串訪問,並將所有系統根證書導出到 /usr/local/etc/openssl 目錄中

Stone Info Labs 的解決方案效果很好——

想要增加清晰度——

/usr/local/etc/openssl 中已經/應該有一個 cert.pem 文件,它可能是一個空白文件。 當您從 Keychain 導出系統根證書時,Certificates.pem 需要重命名為 cert.pem 否則您可以將原始證書代碼復制並粘貼到該文件中。

你很快就會釀造出來的。

我對這個問題很生氣。 我的修復如下:

brew install openssl@3
mkdir -p  /usr/local/etc/openssl/certs/
ln -s /usr/local/etc/openssl@3/cert.pem /usr/local/etc/openssl/certs/cert.pem 
rbenv install 3.1.2
# success

請參閱此處Rbenv 安裝 3.1.2 在 Mac 12.6 (21G115) 上失敗 #2061 @ rbenv/ruby-build

我正在嘗試brew tap aws/tap並得到相同的錯誤error setting certificate verify locations: CAfile: /etc/ssl/cert.pem CApath: none

我嘗試git config --global http.sslverify false但仍然沒有修復,然后我運行git config --list並發現配置列表中有兩個配置出於某種奇怪的原因 -
http.sslverify=false
http.sslverify=true我刪除了第二個並且它起作用了。 希望這對某人有幫助,祝你好運。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM