271

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?

Farshid Ashouri
  • 16,143
  • 7
  • 52
  • 66
cfranco
  • 3,155
  • 5
  • 19
  • 20
  • 2
    Stack Overflow is a site for programming and development questions. This question appears to be off-topic because it is not about programming or development. See [What topics can I ask about here](http://stackoverflow.com/help/on-topic) in the Help Center. Perhaps [Super User](http://superuser.com/) or [Apple Stack Exchange](http://apple.stackexchange.com/) would be a better place to ask. Also see [Where do I post questions about Dev Ops?](http://meta.stackexchange.com/q/134306). – jww Feb 13 '16 at 10:15
  • 4
    Please keep this question and answer. At least move the question to Super User if neccessary. – nalply Apr 06 '16 at 08:45
  • For anyone looking for a binary of wget for Mac 10.3+, without any make/install/port/brew/curl junk: https://stackoverflow.com/a/51275416/3672465 – Beejor Feb 04 '19 at 21:19
  • brew/curl _junk_? – abbood May 11 '23 at 09:31

5 Answers5

644

Using brew

First install brew:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

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
Farshid Ashouri
  • 16,143
  • 7
  • 52
  • 66
13

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".

  3. 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.

  4. 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.

Sun Junwen
  • 1,068
  • 10
  • 20
6

You need to do

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

Instead of this

./configure --with-ssl=openssl

user6795317
  • 141
  • 4
  • 10
-2

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!

Rakesh James
  • 624
  • 7
  • 13
-10
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.

thewaywewere
  • 8,128
  • 11
  • 41
  • 46
Nandan B
  • 21
  • 1
  • 1
    This is exactly the same as the accepted answer and is older, yet has got a vote of -1 whilst the accepted answer has a vote of 122. Why? – giles123 Aug 01 '17 at 09:38
  • 2
    @giles123 this answer was submitted 15-Jun-2017, while the accepted answer was submitted 24-Nov-2015. I guess this answer is getting downvoted because it's a shameless copy of the accepted answer – Cocowalla Sep 14 '17 at 10:01
  • Oops, sorry, I read "Jun 15" as "June 2015"! Don't know where I thought the day had gone. :"> – giles123 Sep 26 '17 at 14:30