Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.12.6
-
None
Description
- Use a proxy which requires authentication. Either specify it in global system settings, or in app using Qt API.
- Connect to QNetworkAccessManager::proxyAuthenticationRequired and provide user name and password there.
- Bug: in some cases Qt fires this signal several times, despite the fact that credentials are always correct.
I've made some investigation and found that this happens when you set custom QNetworkRequest::UserAgentHeader and trying to access some specific URLs.
E.g. some cases:
1. Just: QNetworkRequest request(QUrl("https://rutracker.org/forum/dl.php?t=4005246"));
Problem is NOT happening. Log is showing:
onProxyAuthenticationRequired
2. QNetworkRequest request(QUrl("https://rutracker.org/forum/dl.php?t=4005246"));
request.setHeader(QNetworkRequest::UserAgentHeader, "FDM/6.0.0.0");
Problem IS happening. Log is showing:
onProxyAuthenticationRequired
onProxyAuthenticationRequired
QNetworkAccessCache::addEntry: overriding active cache entry 'auth:proxy-http://REMOVED@REMOVED:3130#=FDM%20TEST%20Proxy%20Server='
QNetworkAccessCache::addEntry: overriding active cache entry 'auth:proxy-http://REMOVED@REMOVED:3130'
QNetworkAccessCache::addEntry: overriding active cache entry 'auth:proxy-http://REMOVED:3130'
onProxyAuthenticationRequired
QNetworkAccessCache::addEntry: overriding active cache entry 'auth:proxy-http://REMOVED@REMOVED:3130#=FDM%20TEST%20Proxy%20Server='
QNetworkAccessCache::addEntry: overriding active cache entry 'auth:proxy-http://REMOVED@REMOVED:3130'
QNetworkAccessCache::addEntry: overriding active cache entry 'auth:proxy-http://REMOVED:3130'
onProxyAuthenticationRequired
QNetworkAccessCache::addEntry: overriding active cache entry 'auth:proxy-http://REMOVED@REMOVED:3130#=FDM%20TEST%20Proxy%20Server='
QNetworkAccessCache::addEntry: overriding active cache entry 'auth:proxy-http://REMOVED@REMOVED:3130'
QNetworkAccessCache::addEntry: overriding active cache entry 'auth:proxy-http://REMOVED:3130'
3. QNetworkRequest request(QUrl("https://ya.ru"));
request.setHeader(QNetworkRequest::UserAgentHeader, "FDM/6.0.0.0");
Problem is NOT happening. Log is showing:
onProxyAuthenticationRequired
I've attached a minimal reproducible example.