3

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?

Babu
  • 4,324
  • 6
  • 41
  • 60
  • Just Google `download curl OSX` and skip the bogus results (ads etc) until you locate the official site i.e. `curl.haxx.se` >> https://curl.haxx.se/download.html#MacOSX >> then dig into the different sites mentioned there to find a recent binary version that supports _negotiate_ (note that versions reported in `curl.haxx.se` may be outdated) – Samson Scharfrichter Jul 17 '17 at 22:10

3 Answers3

2

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 .

1

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)

Horace
  • 141
  • 1
  • 3
-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
Babu
  • 4,324
  • 6
  • 41
  • 60
  • 3
    Can you tell me how you get this older version installed ? TIA. –  Jan 14 '18 at 09:23
  • Wait, so you had Curl version 7.52.1, and the version of Curl that supports --negotiate is Curl 7.43.0 or higher? So shouldn't that have worked in the first place? – Michael Innes Apr 10 '18 at 22:20
  • 2
    seriously, leaving this answer without commenting how you downgraded your libcurl version is rather bad :) – hummingBird Oct 08 '18 at 08:25
  • ...the problem was different curl versions, not "how to install different curl on Mac"...anyway I am using brew, how to install specific version is very nicely described here: https://stackoverflow.com/questions/3987683/homebrew-install-specific-version-of-formula – Babu Oct 18 '18 at 11:38