'curl with Kerberos error: option --negotiate: the installed libcurl version doesn't support this

I would like to use curl with Kerberos

curl --negotiate '<SOME_ULR>'

or

curl --negotiate -u : '<SOME_ULR>'

But I got the error:

curl: option --negotiate: the installed libcurl version doesn't support this

My OS: OS X El Capitan

Curl version:

curl -V
curl 7.52.1 (x86_64-apple-darwin13.4.0) libcurl/7.52.1 OpenSSL/1.0.2l zlib/1.2.8
Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: IPv6 Largefile NTLM NTLM_WB SSL libz TLS-SRP UnixSockets HTTPS-proxy

Any Ideas?



Solution 1:[1]

I found it. My problem was in curl version

Actuall curl version supporting --negotiate

curl -V

curl 7.43.0 (x86_64-apple-darwin15.0) libcurl/7.43.0 SecureTransport zlib/1.2.5
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: AsynchDNS IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz UnixSockets

Solution 2:[2]

you can try "--anyauth" option which tells curl to figure out authentication method by itself.

--anyauth

(HTTP) Tells curl to figure out authentication method by itself, and use the most secure one the remote site claims it supports. This is done by first doing a request and checking the response-headers, thus inducing an extra network round-trip. This is used instead of setting a specific authentication method, which you can do with --basic, --digest, --ntlm, and --negotiate. (Added in 7.10.6)

Solution 3:[3]

I fixed the issue in MacOs by installing the latest curl from brew :

brew install curl

after that, I used the following command, so that my terminal picks up the curl by homebrew

echo 'export PATH="/opt/homebrew/opt/curl/bin:$PATH"' >> ~/.zshrc

source ~/.zshrc

u can verify, that correct curl is picked up by ur terminal now, by using the following command.

which curl

expected output : /opt/homebrew/opt/curl/bin/curl

Note : u might wanna use .bashrc, if u don't have .zshrc present in home directory of ur machine OR u can create .zshrc file .

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Babu
Solution 2 Horace
Solution 3 Utkarsh Sharma