I'm struggling with downloading a simple web page with QNetworkAccessManager. I encounter a proxy authentication issue which I can't overcome.
Here's a snippet of my code:
QNetworkAccessManager manager = new QNetworkAccessManager(this);
connect(manager, SIGNAL(finished(QNetworkReply)), this, SLOT(replyFinished(QNetworkReply*)));
QNetworkProxy proxy(QNetworkProxy::HttpProxy, "my_proxy_host", 8080, "MY_DOMAIN//my_user", "my_password");
I've sniffed the HTTP traffic with Wireshark, and here's what it's logged:
@[truncated] Proxy-Authorization: NTLM TlRMTVNTUAADAAAAAAAAAFQAAADaANoAVAAAABQAFABAAAAAAAAAAFQAAAAAAAAAVAAAAAAAAAAAAAAAAQIAAEYARQBSAFIARQBSAE8ATgBFAFQAe63Ac4fenpjEZxAU3IlPgQEBAAAAAAAAgHLoLSaYzQE5Y2NiYTU0YQAAAAACABQARgBFAFIAUgBFAFIATwBOAEUAV
NTLM Secure Service Provider
NTLMSSP identifier: NTLMSSP
NTLM Message Type: NTLMSSP_AUTH (0x00000003)
Lan Manager Response: Empty
NTLM Response: 7badc07387de9e98c4671014dc894f810101000000000000...
NTLM Client Challenge: 3963636261353461
Domain name: MY_DOMAIN
User name: NULL
Host name: NULL
Session Key: Empty
The issue seems to be username remains NULL, even though I specified a value for it in QNetworkProxy constructor. I presume the password is blank as well.
As you see, NTLM authentication is involved in my scenario. I suspect it's NTLM v2 and something is wrong with QT and NTLM v2. Not sure though, as I don't have access to the proxy server and I cannot verify whether it uses v2 indeed.
Do you have any information / suggestion on this issue? Thanks!