如何在旧的OSX中使用`curl`?

问题描述 投票:0回答:1

我有一台具有以下特点的旧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'
macos curl osx-leopard
1个回答
2
投票

我没有对此进行测试,但您可以运行一个Web代理,该代理接受旧版本的TLS(https)连接(如v10.5的curl知道如何操作),然后将更新版本的TLS连接更新为网络服务器。有关如何配置squid的设置以执行此操作的信息,请参阅问题Can I use Squid to upgrade client TLS connections?Squidman可以使用普通的http下载,并包含一个预先构建的squid副本(以及GUI设置/包装应用程序)。 Squidman v3.1是最后一个支持OS X v10.5的,我不知道哪些版本的TLS会支持。

在OS X中,有两种不同的方法来配置客户端软件以使用代理。对于GUI应用程序(浏览器等),您可以在系统偏好设置 - >网络窗格中进行相关设置 - >选择相关服务/界面 - >高级按钮 - >代理选项卡。对于像curl这样的CLI工具,您通常可以向它们传递显式选项(可能在此处不起作用),或设置环境变量,例如export HTTPS_PROXY=https://127.0.0.1:8080

如果你可以将OS X升级到v10.6,curl的内置版本仍然非常有限,但你将能够运行更新版本的Squidman(虽然不一定是最新的 - 它支持v10.6,但只有64 -bit Intel CPUs)。苹果显然是still sells OS X v10.6 on DVD through their online store。请注意,他们还列出了较新的版本,但他们得到的只是在App Store中使用的下载代码...直到v10.6.6才添加。

© www.soinside.com 2019 - 2024. All rights reserved.