cURL / Mailing Lists / curl-users / Single Mail

curl-users

转发: libcurl 401

From: Jason Liu <jason.liu_at_torchmobile.com.cn>
Date: Mon, 23 Apr 2012 05:13:58 -0400

Would you tell me how to set nonce into libcurl?
Thank you very much.

________________________________
发件人: Jason Liu <jasonliuwebkit_at_gmail.com> :
收件人: Jason Liu :
发送时间: Mon Apr 23 05:10:03 2012
主题: libcurl 401 :

Hi,
   I receive a response with 401.
   WWW-Authenticate: Digest realm="test", nonce="U9bKz1S+BAA=013f94cb0d1c6653d4fb65ae41b3219065a573c8", algorithm=MD5, domain="/auth-digest/", qop="auth"\r\n
   This is a header received from libcurl.
   And I get a username and a password for this 401.
   Now, I use curl_easy_setopt(m_handle, CURLOPT_HTTPAUTH, CURLAUTH_DIGEST);
                     curl_easy_setopt(m_handle, CURLOPT_USERNAME, Username());
                     curl_easy_setopt(m_handle, CURLOPT_PASSWORD, Password());
    And will get 401 again.

   Is there any API to set the nonce into libcurl to prevent getting 401 again?

   Or do I have to compute a response by myself and then set as a request's header?

Thank you very much.
Jason Liu







---------------------------------------------------------------------
This transmission (including any attachments) may contain confidential information, privileged material (including material protected by the solicitor-client or other applicable privileges), or constitute non-public information. Any use of this information by anyone other than the intended recipient is prohibited. If you have received this transmission in error, please immediately reply to the sender and delete this information from your system. Use, dissemination, distribution, or reproduction of this transmission by unintended recipients is not authorized and may be unlawful.

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2012-04-23