问题描述
我最近开始在客户端-服务器通信项目中使用 libCurl,我在客户端使用 libcurl。我们曾经使用 WinHTTP,但没有找到一种方法来添加与早期 Windows 版本的 TLS 1.3 向后兼容性。
cnonce 是 Digest Authentication 标头的一部分。
当我的项目更早使用 WinHTTP 时,cnonce 曾经是十六进制的。 例如:
cnonce="a01e21c2a827ec6d3d9b6e1745ca8a0b"
HTTP 标头
服务器到客户端:
HTTP/1.1 401 Unauthorized
Content-Length: 26
WWW-Authenticate: Negotiate
WWW-Authenticate: Digest realm="a2ffc77914d6e791d",qop="auth",nonce="3f3da4b94e249058",opaque ="3b3542c"
客户端到服务器:
POST /wsman HTTP/1.1
Connection: Keep-Alive
Content-Type: application/soap+xml;charset=UTF-8
User-Agent: Openwsman
Content-Length: 889
Host: 10.138.141.178:623
Authorization: Digest username="PostMan",realm="a2ffc77914d6e791d",uri="/wsman",cnonce="a01e21c2a827ec6d3d9b6e1745ca8a0b",nc=00000001,response="9dd37ef997ef332e46dff0f868b3de89",opaque="3b3542c"
当我查看 HTTP 标头时,我发现 cnonce 是带有 Curl 的字母数字。 例如:
cnonce="NDlmYTM0ZjVlM2IzNTNhMDNiNDk0MzQ1MzdlYmFlMzA="
HTTP 标头
服务器到客户端
HTTP/1.1 401 Unauthorized
Content-Length: 0
Connection: Keep-Alive
Content-Type: application/soap+xml;charset=UTF-8
WWW-Authenticate: Digest realm="a2ffc77914d6e791d",nonce="5bf1156647e8eb42",algorithm="MD5",opaque="661d9eae",userhash=true
客户端到服务器
POST /wsman HTTP/1.1
Host: blr-5cg64728l6.amd.com:623
Authorization: Digest username="PostMan",cnonce="NDlmYTM0ZjVlM2IzNTNhMDNiNDk0MzQ1MzdlYmFlMzA=",qop=auth,response="6847e465c9c90b40264b736070f721da",algorithm=MD5,userhash=true
Accept: */*
Content-Type: application/soap+xml;charset=UTF-8
User-Agent: Openwsman
Content-Length: 897
使用字母数字 cnonce,服务器无法持续响应。有没有办法在 libcurl 中指定生成十六进制的 cnonce - 显式?
我正在使用 LibCurl:7.73 使用 OpenSSL TLS 后端:1.1.1h
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)