【问题标题】:How to do curl ntlm authentication with an xml response如何使用 xml 响应进行 curl ntlm 身份验证
【发布时间】:2018-03-11 23:43:21
【问题描述】:

我正在尝试从服务器获取 xml 响应,但我得到了这个:SPNEGO 找不到协商机制

你们知道怎么做吗?

$ curl http://example.com:86/DynamicsNAV80/WS/nasr/Page/Delivery -v --ntlm --negotiate -u nasr\\jason:tty5Rx53$_sj
* Hostname was NOT found in DNS cache
*   Trying 21.55.152.170...
* Connected to example.com (21.55.152.170) port 86 (#0)
> GET /DynamicsNAV80/WS/nasr/Page/Delivery HTTP/1.1
> User-Agent: curl/7.38.0
> Host: example.com:86
> Accept: */*
> 
< HTTP/1.1 401 Unauthorized
< Content-Length: 0
* Server Microsoft-HTTPAPI/2.0 is not blacklisted
< Server: Microsoft-HTTPAPI/2.0
< WWW-Authenticate: Negotiate
< Date: Sun, 11 Mar 2018 23:20:34 GMT
< 
* Connection #0 to host example.com left intact
* Issue another request to this URL: 'http://example.com:86/DynamicsNAV80/WS/nasr/Page/Delivery'
* Found bundle for host example.com: 0x5558f1e0d4e0
* Re-using existing connection! (#0) with host example.com
* Connected to example.com (21.55.152.170) port 86 (#0)
> GET /DynamicsNAV80/WS/nasr/Page/Delivery HTTP/1.1
> User-Agent: curl/7.38.0
> Host: example.com:86
> Accept: */*
> 
< HTTP/1.1 401 Unauthorized
< Content-Length: 0
* Server Microsoft-HTTPAPI/2.0 is not blacklisted
< Server: Microsoft-HTTPAPI/2.0
* gss_init_sec_context() failed: : SPNEGO cannot find mechanisms to negotiate
< WWW-Authenticate: Negotiate
< Date: Sun, 11 Mar 2018 23:20:34 GMT
< 
* Connection #0 to host example.com left intact

【问题讨论】:

    标签: authentication curl ntlm


    【解决方案1】:

    尝试升级您的 curl 版本。我以前遇到过同样的问题(HTTP/1.1 401 Unauthorized)。一旦我将 curl 升级到 7.45.0(或最新版本),问题就解决了。请仔细阅读下面的图片以更好地理解。

    curl 版本 7.38.0 的问题。 NTLM 已禁用:

    使用 curl 版本 7.45.0 解决了问题。 NTLM 以及其他一些参数也已启用。:

    【讨论】:

      猜你喜欢
      • 2018-04-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-03-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多