首页 > 解决方案 > 如何在旧 OSX 中使用“curl”?

问题描述

我有一台旧的 Mac mini 2006,具有以下特点:

  System Version: Mac OS X 10.5.8 (9L31a)
  Kernel Version: Darwin 9.8.0
  Boot Volume: Macintosh HD

我需要在其上安装一些工具。

首先请注意,我无法使用浏览器,因为它已过时并且菜单中没有可用的软件更新。

我需要安装旧版本的 openCV 和 NodeJS 工具,例如nvm npm nodeExpress和其他一些工具。

但是wget不被识别为命令并curl返回错误,建议使用curl --insecure.

命令curl --insecure返回错误

curl: (35) error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version

虽然对于 openCV,我可以在另一台计算机上下载源代码,然后将其复制到那里,但我想不出安装其他工具的任何解决方法(直接或brew安装完成后使用curl)。

所以我的问题是:如何curl在这个 OSX 版本上工作,或者至少如何更新它?

EDIT1:尝试安装自制软件我首先下载了命令,将文件复制到 minimac 中并尝试执行它。错误是:

We (and Apple) do not provide support for this old version.
This installation may not succeed.
After installation, you will encounter build failures and other breakages.
Please create pull-requests instead of asking for help on Homebrew's
GitHub, Discourse, Twitter or IRC. As you are running this old version,
you are responsible for resolving any issues you experience.

==> This script will install:
/usr/local/bin/brew
/usr/local/share/doc/homebrew
/usr/local/share/man/man1/brew.1
/usr/local/share/zsh/site-functions/_brew
/usr/local/etc/bash_completion.d/brew
/usr/local/Homebrew

Press RETURN to continue or any other key to abort
==> Downloading and installing Homebrew...
curl: (35) error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version

gzip: stdin: unexpected end of file
/usr/bin/tar: Child returned status 1
/usr/bin/tar: Error exit delayed from previous errors
Failed during: /bin/bash -o pipefail -c '/usr/bin/curl -fsSLk https://github.com/Homebrew/brew/tarball/master | /usr/bin/tar xz -m --strip 1'

标签: macoscurlosx-leopard

解决方案


我尚未对此进行测试,但您可能能够运行一个接受旧版本 TLS (https) 连接的网络代理(如 v10.5curl知道如何做),然后将新版本 TLS 连接到网络服务器。请参阅问题我可以使用 Squid 升级客户端 TLS 连接吗?有关如何配置 squid 的设置来执行此操作的信息。Squidman可通过普通 http 下载,并包括一个预构建的 squid 副本(以及一个 GUI 设置/包装应用程序)。Squidman v3.1 是最后一个支持 OS X v10.5 的,我不知道会支持哪些版本的 TLS。

在 OS X 中,有两种不同的方式来配置客户端软件以使用代理。对于 GUI 应用程序(浏览器等),您可以在系统偏好设置 -> 网络窗格 -> 选择相关服务/接口 -> 高级按钮 -> 代理选项卡中进行相关设置。curl对于像export HTTPS_PROXY=https://127.0.0.1:8080.

如果您可以将 OS X 升级到 v10.6,则内置版本curl仍然非常有限,但您将能够运行更新版本的 Squidman(虽然不一定是最新的——它支持 v10.6,但只有 64-位英特尔 CPU)。Apple 显然仍然通过其在线商店销售 DVD 版 OS X v10.6。请注意,他们还列出了较新的版本,但他们得到的只是在 App Store 中使用的下载代码……直到 v10.6.6 才添加。


推荐阅读