cURL / Mailing Lists / curl-users / Single Mail

curl-users

Curl & digest & nonce

From: δΕΝΑ βΑΫΜΟΧ <dema501_at_mail.ru>
Date: Thu, 29 Nov 2007 15:49:34 +0300

Hello people,

I try to use curl for download some file.

Here some log

-------------------BEGIN

curl -v -k --retry 1 --retry-delay 10 --connect-timeout 30 --max-time 180 -L --user-agent 'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/124 (KHTML, like Gecko) Safari/125.1' --referer 'https://trade.xxxx.ru/RestrictedArea/Default.aspx' --user fastpc:*** --digest https://trade.xxxx.ru/RestrictedArea/Excel/PriceList.xls > PriceList.xls

* About to connect() to trade.xxxx.ru port 443 (#0)
* Trying xxx.xxx.xxx.xxx... connected
* Connected to trade.xxxx.ru (xxx.xxx.xxx.xxx) port 443 (#0)
* successfully set certificate verify locations:
* CAfile: /etc/ssl/certs/ca-certificates.crt
  CApath: none
* SSLv2, Client hello (1):
} [data not shown]
* SSLv3, TLS handshake, Server hello (2):
{ [data not shown]
* SSLv3, TLS handshake, CERT (11):
{ [data not shown]
* SSLv3, TLS handshake, Server finished (14):
{ [data not shown]
* SSLv3, TLS handshake, Client key exchange (16):
} [data not shown]
* SSLv3, TLS change cipher, Client hello (1):
} [data not shown]
* SSLv3, TLS handshake, Finished (20):
} [data not shown]
* SSLv3, TLS change cipher, Client hello (1):
{ [data not shown]
* SSLv3, TLS handshake, Finished (20):
{ [data not shown]
* SSL connection using RC4-MD5
* Server certificate:
* subject: /C=RU/ST=Moscow/L=Moscow/O=Bureaucrat/OU=IT Department/CN=trade.xxxx.ru
* start date: 2007-02-08 09:47:14 GMT
* expire date: 2008-02-08 09:57:14 GMT
* common name: trade.xxxx.ru (matched)
* issuer: /DC=ru/DC=buro/CN=web
* SSL certificate verify result: unable to get local issuer certificate (20), continuing anyway.
* Server auth using Digest with user 'fastpc'
> GET /RestrictedArea/Excel/PriceList.xls HTTP/1.1
> User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/124 (KHTML, like Gecko) Safari/125.1
> Host: trade.xxxx.ru
> Accept: */*
> Referer: https://trade.xxxx.ru/RestrictedArea/Default.aspx
>
< HTTP/1.1 401 Unauthorized
< Date: Thu, 29 Nov 2007 02:46:20 GMT
< Server: Microsoft-IIS/6.0
< X-Powered-By: ASP.NET
< X-AspNet-Version: 1.1.4322
< WWW-Authenticate: Digest realm="trade_at_xxxx.ru", nonce="nJ6n+/QSADeEbNzMB+HS6qG/TTXa22fhaiPOineuWZuPZIIf/y4jwD4VjCLRkegIXfXUK/RqbNcM9KbVBrW6s1c/0RvXqspTzbeYZB2S4ljspMbQVtbePdBZ+ngKA/eHPaNtvjWnbuWXhgnnlO8crntR+O99hjuh9hS16ZEAjPbuo5wczrnQJcrWAeZ9U25bnzVnJ08iRD4Cv5HOWYRZjvzRFyo3olUihXxEtWO/s6PReBf73rBa9qZsmAXtkDWkAVYgNfRculzI41nkV/TCOpYoFtYPoqHUPNqu05/pw1bwxXPzKrZHBpSkqDDAzMnPsGjj+9jODtSv7VKPPqX+pm2qm4OPVrzSVFsP52jglrsjM56wmQSCiuYb64ZgHeuKEIqdIJhky9dbd/1SPbB/bnF+AbMhKr8n2JHN/LIjBZg5DxnujX41RdDR5WCahfku3vDcWts/vQpC1ejOJSujixEm89FSVgQTNU0yIf2x2dwkmG+CZOwCB0j9iDkdLxQEAjHJL/UHnODKj5B1gP583k1NRccg1dHe8DU6HcoIA0N0a5dJrMeI/X6OiFDfX9QOBT+qYCm1PzVttSt5djR/ekc32UFnjDUEBy/p79Pqe2bp4GmlXTI6j5uFL6KdcGowntd0dP3Pfgw9JwYWB6/lnvUlMoOSn2UbH+H5qfo8uLLF9a7HVjZwwWeJEHC6B/aO", algorithm="MD5", qop="auth"
< Cache-Control: private
< Content-Type: text/html; charset=windows-1251
< Content-Length: 13
<
* Ignoring the response-body
{ [data not shown]
  % Total % Received % Xferd Average Speed Time Time Time Current
                                 Dload Upload Total Spent Left Speed
  0 13 0 13 0 0 55 0 --:--:-- --:--:-- --:--:-- 0* Connection #0 to host trade.xxxx.ru left intact
* Issue another request to this URL: 'https://trade.xxxx.ru/RestrictedArea/Excel/PriceList.xls'
* Re-using existing connection! (#0) with host trade.xxxx.ru
* Connected to trade.xxxx.ru (xxx.xxx.xxx.xxx) port 443 (#0)
* Server auth using Digest with user 'fastpc'
> GET /RestrictedArea/Excel/PriceList.xls HTTP/1.1
> Authorization: Digest username="fastpc", realm="trade_at_xxxx.ru", nonce="nJ6n+/QSADeEbNzMB+HS6qG/TTXa22fhaiPOineuWZuPZIIf/y4jwD4VjCLRkegIXfXUK/RqbNcM9KbVBrW6s1c/0RvXqspTzbeYZB2S4ljspMbQVtbePdBZ+ngKA/e", uri="/RestrictedArea/Excel/PriceList.xls", response="6ecf1e27e3aa90f03401d4a610f893e3"
> User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/124 (KHTML, like Gecko) Safari/125.1
> Host: trade.xxxx.ru
> Accept: */*
> Referer: https://trade.xxxx.ru/RestrictedArea/Default.aspx
>
< HTTP/1.1 500 Internal Server Error
< Date: Thu, 29 Nov 2007 02:46:20 GMT
< Server: Microsoft-IIS/6.0
< X-Powered-By: ASP.NET
< X-AspNet-Version: 1.1.4322
< Cache-Control: private
< Content-Type: text/html; charset=windows-1251
< Content-Length: 4940
<
{ [data not shown]
100 4940 100 4940 0 0 16945 0 --:--:-- --:--:-- --:--:-- 16945* Connection #0 to host trade.xxxx.ru left intact

-------------------END

Look - Microsoft-IIS/6.0 take too big nonce

nonce="nJ6n+/QSADeEbNzMB+HS6qG/TTXa22fhaiPOineuWZuPZIIf/y4jwD4VjCLRkegIXfXUK/RqbNcM9KbVBrW6s1c/0RvXqspTzbeYZB2S4ljspMbQVtbePdBZ+ngKA/eHPaNtvjWnbuWXhgnnlO8crntR+O99hjuh9hS16ZEAjPbuo5wczrnQJcrWAeZ9U25bnzVnJ08iRD4Cv5HOWYRZjvzRFyo3olUihXxEtWO/s6PReBf73rBa9qZsmAXtkDWkAVYgNfRculzI41nkV/TCOpYoFtYPoqHUPNqu05/pw1bwxXPzKrZHBpSkqDDAzMnPsGjj+9jODtSv7VKPPqX+pm2qm4OPVrzSVFsP52jglrsjM56wmQSCiuYb64ZgHeuKEIqdIJhky9dbd/1SPbB/bnF+AbMhKr8n2JHN/LIjBZg5DxnujX41RdDR5WCahfku3vDcWts/vQpC1ejOJSujixEm89FSVgQTNU0yIf2x2dwkmG+CZOwCB0j9iDkdLxQEAjHJL/UHnODKj5B1gP583k1NRccg1dHe8DU6HcoIA0N0a5dJrMeI/X6OiFDfX9QOBT+qYCm1PzVttSt5djR/ekc32UFnjDUEBy/p79Pqe2bp4GmlXTI6j5uFL6KdcGowntd0dP3Pfgw9JwYWB6/lnvUlMoOSn2UbH+H5qfo8uLLF9a7HVjZwwWeJEHC6B/aO"

Nonce has been cut in second request by curl
nonce="nJ6n+/QSADeEbNzMB+HS6qG/TTXa22fhaiPOineuWZuPZIIf/y4jwD4VjCLRkegIXfXUK/RqbNcM9KbVBrW6s1c/0RvXqspTzbeYZB2S4ljspMbQVtbePdBZ+ngKA/e"

Why did cut a original nonce?

Can I fix it?
Received on 2007-11-29