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

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

我想将 curl 与 Kerberos 一起使用

curl --negotiate '<SOME_ULR>'

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

但是我得到了错误:

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

我的 OS:OS X El Capitan

卷曲版本:

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

有什么想法吗?

我找到了。我的问题是卷曲版本

支持--negotiate的实际curl版本

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

你可以尝试“--anyauth”选项,它告诉 curl 自己找出身份验证方法。

--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)

我通过从 brew 安装最新的 curl 解决了 MacOs 中的问题:

brew install curl

之后,我使用了以下命令,这样我的终端就可以通过自制程序获取 curl

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

source ~/.zshrc

您可以使用以下命令验证您的终端现在是否拾取了正确的 curl。

which curl

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

注意:如果您机器的主目录中没有 .zshrc,或者您可以创建 .zshrc 文件,您可能想使用 .bashrc。