简体   繁体   English

各种自制软件安装中的 cURL 错误

[英]cURL error in various homebrew installations

I'm using my (quite old) Macbook with macOS 10.10.我正在使用我的(相当旧的)Macbook 和 macOS 10.10。 I have been struggling to install the following programs using homebrew: ffmpeg, cairo, and sox.我一直在努力使用自制软件安装以下程序:ffmpeg、cairo 和 sox。 Whenever I run brew install ffmpeg it al runs well until eventually, I run into the following error:每当我运行brew install ffmpeg它一直运行良好,直到最终,我遇到以下错误:

==> Downloading https://download.gnome.org/sources/glib/2.64/glib-2.64.3.tar.xz

curl: (35) SSL peer handshake failed, the server most likely requires a client certificate to connect
Error: Failed to download resource "glib"
Download failed: https://download.gnome.org/sources/glib/2.64/glib-2.64.3.tar.xz

As far as I know, there is an issue with the version of cURL being used, which does not support OpenSSL, and SecureTransport is getting in the way.据我所知,使用的 cURL 版本存在问题,它不支持 OpenSSL,并且 SecureTransport 正在阻碍。 I saw this when running:我在运行时看到了这个:

curl 7.43.0 (x86_64-apple-darwin14.0) libcurl/7.43.0 SecureTransport zlib/1.2.5
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp 
Features: AsynchDNS IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz UnixSockets

It seems that the cURL that is being used is the one built in with the OS, I tried switching to the homebrew one by editing my $PATH in my .bash_profile , and ran the following, finding SecureTransport again:似乎正在使用的 cURL 是操作系统内置的,我尝试通过在我的.bash_profile中编辑我的$PATH来切换到自制软件,然后运行以下命令,再次找到 SecureTransport:

$ which curl
/usr/local/opt/curl/bin/curl
$ curl -V
curl 7.71.1 (x86_64-apple-darwin14.5.0) libcurl/7.71.1 SecureTransport zlib/1.2.5
Release-Date: 2020-07-01

but this was no help.但这无济于事。 I also tried brew upgrade , brew uninstall curl and then brew install curl-openssl but this homebrew installation also runs into the same curl(35) error.我也试过brew upgradebrew uninstall curl然后brew install curl-openssl但是这个自制软件安装也遇到了同样的 curl(35) 错误。

How can I disable SecureTransport?如何禁用 SecureTransport? Is there any other possible fix?还有其他可能的解决方法吗? Is it necessary for me to update my macOS to a more recent version?我有必要将我的 macOS 更新到更新的版本吗?

First of all, feel pretty bad for your situation that homebrew only supports the latest three MacOS versions (which are high-sierra, mojave and catalina at this moment), this aligns with the Apple's security patch policy as well.首先,对你的情况感到很遗憾,因为 homebrew 只支持最新的三个 MacOS 版本(目前是 high-sierra、mojave 和 catalina),这也符合苹果的安全补丁政策。

Second, regarding your glib downloading issue, I just did a download myself, seems working fine now (we usually use bintray homebrew mirror to mitigate the issue like this), but I just checked the homebrew core codebase, we did not have mirror for gnome source artifacts though (hope that you won't run into such issue again).其次,关于你的glib下载问题,我自己做了一个下载,现在看起来工作正常(我们通常使用bintray自制镜像来缓解这样的问题),但我只是检查了自制核心代码库,我们没有 gnome 的镜像虽然源工件(希望你不会再遇到这样的问题)。

Third, regarding how to override the MacOS default curl, you can just do echo 'export PATH="/usr/local/opt/curl/bin:$PATH"' >> ~/.bash_profile && source ~/.bash_profile .第三,关于如何覆盖 MacOS 默认的 curl,您可以执行echo 'export PATH="/usr/local/opt/curl/bin:$PATH"' >> ~/.bash_profile && source ~/.bash_profile

Here is what I have in my local before/after:这是我在本地之前/之后的内容:

$ ls -al $(which curl)
-rwxr-xr-x  1 root  wheel  185072 May 20 04:14 /usr/bin/curl

$ curl --version
curl 7.54.0 (x86_64-apple-darwin18.0) libcurl/7.54.0 LibreSSL/2.6.5 zlib/1.2.11 nghttp2/1.24.1
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: AsynchDNS IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz HTTP2 UnixSockets HTTPS-proxy
$ ls -al $(which curl)
-r-xr-xr-x  1 rchen  staff  209876 Jul  4 15:58 /usr/local/opt/curl/bin/curl

$ curl --version
curl 7.71.1 (x86_64-apple-darwin18.7.0) libcurl/7.71.1 SecureTransport zlib/1.2.11
Release-Date: 2020-07-01
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: AsynchDNS IPv6 Largefile libz NTLM NTLM_WB SSL UnixSockets

Final comment is if you don't have to install the latest ffmpeg , cairo , and sox , I can probably find you the bottles for MacOS 10.10 .最后的评论是,如果您不必安装最新的ffmpegcairosox ,我可能会为您找到适用于MacOS 10.10的瓶子。

Hope it helps.希望能帮助到你。

Use the homebrew-installed curl instead.请改用自制软件安装的curl For that set HOMEBREW_FORCE_BREWED_CURL .对于该设置HOMEBREW_FORCE_BREWED_CURL From man brew来自man brew

If set, always use a Homebrew-installed curl(1) rather than the system version.如果设置,请始终使用 Homebrew 安装的 curl(1) 而不是系统版本。 Automatically set if the system version of curl is too old. curl系统版本太旧时自动设置。

Run a command:运行命令:

export HOMEBREW_FORCE_BREWED_CURL=1

It will set an environment variable for the current shell session to use brew curl which is newer than is installed on your system.它将为当前的 shell session 设置一个环境变量,以使用 brew curl 比您系统上安装的版本更新。

You can read about it on official homebrew documentation .您可以在官方自制文档中了解它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM