How to install wget in macOS?

MacosWgetOsx ElcapitanLibsslLibressl

Macos Problem Overview


I try to install wget in MAC OS 10.11.1 but when I run ./configure --with-ssl=openssl I get this error:

configure: error: --with-ssl=openssl was given, but SSL is not available.

How to resolve this problem in OSX 10.11.1?

Macos Solutions


Solution 1 - Macos

Using brew

First install brew:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

And then install wget with brew:

brew install wget

Using MacPorts

First, download and run MacPorts installer (.pkg)

And then install wget:

sudo port install wget

Solution 2 - Macos

For macOS Sierra, to build wget 1.18 from source with Xcode 8.2.

  1. Install Xcode

  2. Build OpenSSL

Since Xcode doesn't come with OpenSSL lib, you need build by yourself. I found this: https://github.com/sqlcipher/openssl-xcode, follow instruction and build OpenSSL lib. Then, prepare your OpenSSL directory with "include" and "lib/libcrypto.a", "lib/libssl.a" in it.

Let's say it is: "/Users/xxx/openssl-xcode/openssl", so there should be "/Users/xxx/openssl-xcode/openssl/include" for OpenSSL include and "/Users/xxx/openssl-xcode/openssl/lib" for "libcrypto.a" and "libssl.a".

  1. Build wget

Go to wget directory, configure:

    ./configure --with-ssl=openssl --with-libssl-prefix=/Users/xxx/openssl-xcode/openssl

wget should configure and found OpenSSL, then make:

    make

wget made out. Install wget:

    make install

Or just copy wget to where you want.

  1. Configure cert

You may find wget cannot verify any https connection, because there is no CA certs for the OpenSSL you built. You need to run:

New way:

If you machine doesn't have "/usr/local/ssl/" dir, first make it.

    ln -s /etc/ssl/cert.pem /usr/local/ssl/cert.pem

Old way:

    security find-certificate -a -p /Library/Keychains/System.keychain > cert.pem
    security find-certificate -a -p /System/Library/Keychains/SystemRootCertificates.keychain >> cert.pem

Then put cert.pem to: "/usr/local/ssl/cert.pem"

DONE: It should be all right now.

Solution 3 - Macos

You need to do

> ./configure --with-ssl=openssl --with-libssl-prefix=/usr/local/ssl

Instead of this

> ./configure --with-ssl=openssl

Solution 4 - Macos

I update mac to Sierra , 10.12.3

My wget stop working.

When I tried to install by typing

brew install wget --with-libressl

I got the following warning

> Warning: wget-1.19.1 already installed, it's just not linked.

Then tried to unsintall by typing

brew uninstall wget --with-libressl

Then I reinstalled by typing

brew install wget --with-libressl

Finally I got it worked.Thank God!

Solution 5 - Macos

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

And then install wget with brew and also enable openressl for TLS support

brew install wget --with-libressl

It worked perfectly for me.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestioncfrancoView Question on Stackoverflow
Solution 1 - MacosFarshid AshouriView Answer on Stackoverflow
Solution 2 - MacosSun JunwenView Answer on Stackoverflow
Solution 3 - Macosuser6795317View Answer on Stackoverflow
Solution 4 - MacosRakesh JamesView Answer on Stackoverflow
Solution 5 - MacosNandan BView Answer on Stackoverflow