简体   繁体   中英

How to use `curl` in old OSX?

I have an old Mac mini 2006 with the following characteristics:

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

on which I need to install some tools.

First of all note that I cannot use the browser because out of date and there are no software updates available from the Menu.

I need to install an old version of openCV and NodeJS tools such as nvm npm nodeExpress and few others.

However wget is not recognized as command and curl returns an error suggesting to use curl --insecure .

The command curl --insecure returns the error

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

While for openCV I could download the source code in another computer and then copy it there, I cannot think of any workaround for installing the other tools (directly or with brew since the installation is done with curl ).

So my question is: how to make curl work on this OSX version or at least how to update it?

EDIT1 : Trying to install homebrew I first downloaded the command, copied the file in the minimac and try to execute it. The error is:

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'

I haven't tested this, but you might be able to run a web proxy that'd accept old-version TLS (https) connections (like v10.5's curl knows how to do) and then make newer-version TLS connections out to the web server. See the question Can I use Squid to upgrade client TLS connections? for info on how to configure squid's settings to do this. Squidman is downloadable with plain http, and includes a prebuilt copy of squid (along with a GUI setup/wrapper application). Squidman v3.1 was the last to support OS X v10.5, and I don't know what versions of TLS that'll support.

In OS X, there are sort of two different ways to configure client software to use a proxy. For GUI apps (browsers, etc), you make the relevant settings in System Preferences -> Network pane -> select the relevant service/interface -> Advanced button -> Proxy tab. For CLI tools like curl , you can generally either pass explicit options to them (probably won't work here), or set environment variables eg export HTTPS_PROXY=https://127.0.0.1:8080 .

If you can upgrade OS X to v10.6, the builtin version of curl is still pretty limited, but you'll be able to run newer version of Squidman (though not necessarily the latest -- it supports v10.6, but only 64-bit Intel CPUs). Apple apparently still sells OS X v10.6 on DVD through their online store . Note that they also list newer versions, but all they get you is a download code to use in the App Store... which wasn't added until v10.6.6.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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