'libcurl with 7.48.0 or 7.64.1 cannot pass digest auth while curl command or firefox can pass using the same web server

libcurl fails with digest auth.

here is the successful request packet sent by curl command tools:

GET /nagios/ HTTP/1.1
Host: 192.168.10.199:1237
Authorization: Digest username="nagiosadmin", realm="Nagios Access", nonce="tTlXosveBQA=576de564444901884945aff938395ea1eebfcc67", uri="/nagios/", cnonce="ZjAzMzEzYjBhZjEwNTI5YjJmYTg4MWM1YTNlY2NmM2U=", nc=00000001, qop=auth, response="cef4cc12da12e16815d14871e1f52a2a", algorithm="MD5"
User-Agent: ecntcwmp 1.0
Accept: */*
Content-Type: text/xml; charset="utf-8"

here is the failed request packet sent by my apps using libcurl:

GET /nagios/ HTTP/1.1
Host: 192.168.10.199:1237
Authorization: Digest username="nagiosadmin", realm="Nagios Access", nonce="HJmj2N/eBQA=5508f134163520bd20710a7bac9c418c502060b3", uri="/nagios/", cnonce="NzcxZThiYWIxMjRkMTJjZDU1ODM5YTdiYjEyYWQzOTU=", nc=00000001, qop=auth, response="a3952ecae08fa17523baa8b614e2040f", algorithm="MD5"
Accept: */*
User-Agent: ecntcwmp 1.0
Content-Type: text/xml; charset="utf-8"

I made the packet almost same as the failed one,but always the second one failed,is should I upgrade the libcurl or some other problem exists?thanks.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source