I'm using Terminal on Mac OS X 10.11.2 and I can't process 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 with ssl:
configure: error: OpenSSL libs and/or directories were not found where specified!
SOLUTION:
For Mac OS X 10.6 or later use this to enable SSL:
./configure --with-darwinssl
SOLUTION:
For Mac OS X 10.6 or later use this to enable SSL:
./configure --with-darwinssl
Following steps helped fix the issue:
(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 doesn't fix, download and rebuild libcurl with following steps, which helped me fix the issue
# 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
Solved it by replacing standard curl with one with nghttp2 support (require brew)
brew install curl --with-nghttp2
brew link curl --force
include --http2
when doing request
example:
curl --http2 https://www.example.com
or:
curl --header 'Access-Token: o.bFbpTuazstlUZXsnyTWTaJq0biZ' \
--http2 https://www.example.com/
Ref:
https://daniel.haxx.se/blog/2016/08/01/curl-and-h2-on-mac/
https://simonecarletti.com/blog/2016/01/http2-curl-macosx/
I made one rookie mistake by adding the URL within quotation marks (curl -v -k "https://URL.com"). After putting the link within apostrophes (curl -v -k 'https://URL.com') curl was accepting the https URL.