How to enable SSL curl on Mac OS X?

I use Terminal on Mac OS X 10.11.2 and I cannot handle any https requests. I always get this error:

curl: (1) Protocol "https" not supported or disabled in libcurl 

I tried this, but I get a "wrong directory" error:

 ./configure --with-ssl=/usr/local/ssl 

Any advice would be helpful.

EDIT:

This is the error I get when trying to install using ssl:

 configure: error: OpenSSL libs and/or directories were not found where specified! 

DECISION:

For Mac OS X 10.6 or later, use this to enable SSL:

 ./configure --with-darwinssl 
+9
terminal curl ssl macos
Jan 21 '16 at 2:41
source share
4 answers

DECISION:

For Mac OS X 10.6 or later, use this to enable SSL:

 ./configure --with-darwinssl 
+7
Jan 21 '16 at 6:12
source share

The following steps helped solve the problem: (Note: libcurl will be rebuilt, though)

 # First simply remove curl and try reinstall with openssl: brew rm curl && brew install curl --with-openssl # Rerun 

If this does not help, download and rebuild libcurl by following these steps that helped me solve the problem.

 # Download curl from : https://curl.haxx.se/download.html wget https://curl.haxx.se/download/curl-7.58.0.zip # or, wget https://curl.haxx.se/download/curl-*.*.* unzip curl-7.58.0.zip # or, unzip curl-*.*.* ./configure --with-darwinssl # However for Linux(ubuntu): ./configure --with-ssl make sudo make install # Rerun the program 
+4
Mar 11 '18 at 17:49
source share

Solved this by replacing the standard curl with nghttp2 support (brew required)

 brew install curl --with-nghttp2 brew link curl --force 

enable --http2 when executing the request

example:

 curl --http2 https://www.example.com 

or:

 curl --header 'Access-Token: o.bFbpTuazstlUZXsnyTWTaJq0biZ' \ --http2 https://www.example.com/ 

Link: https://daniel.haxx.se/blog/2016/08/01/curl-and-h2-on-mac/ https://simonecarletti.com/blog/2016/01/http2-curl-macosx/

+2
Feb 17 '17 at 20:55
source share

I made one newbie mistake by adding the URL in quotation marks (curl -v -k " https://URL.com "). After placing the link in apostrophes (curl -v -k ' https://URL.com ') curl accepts the https URL.

0
Jan 29 '19 at 14:43
source share



All Articles