Summary: | konqueror sends invalid proxy requests when configured for use with proxies (since 4.7.2) | ||
---|---|---|---|
Product: | [Applications] konqueror | Reporter: | Andreas Erhart <andi> |
Component: | general | Assignee: | Dawit Alemayehu <adawit> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | lameventanas, manuel, xman00 |
Priority: | NOR | ||
Version: | Git | ||
Target Milestone: | --- | ||
Platform: | Gentoo Packages | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | 4.7.3 | |
Sentry Crash Report: |
Description
Andreas Erhart
2011-10-11 14:57:40 UTC
Please enable debugging for the HTTP ioslave as specified in http://techbase.kde.org/Development/Tutorials/Debugging/Debugging_IOSlaves#How_to_get_debug_output and post them here so that we can see what is happening in kio_http. Please sanitize the debug file for cookies and other private information. I can tell you for sure that if you are connecting to HTTPS sites through a HTTP proxy server then the request header URL is supposed to be relative since we are directly connected to the remote server. IOW, the proxy server is supposed create a tunnel and let us connect directly to the secured site. After some further investigations I found out that the problem only occures if I use a proxy configuration file (in my case a local proxy.pac file which I'm using for all my browsers). It works perfectly when I use manually configured proxy settings. Additionally I have the enviroment variables $http_proxy, $https_proxy and $ftp_proxy set which might be responsible for sending the requests to our proxies even if http io_slave ignores my proxy.pac. (I will investigate that) I also want to make clear that for me this incident is clearly a regression because it used to work flawlessly with the same configuration before I did the upgrade from 4.7.1 to 4.7.2. Here is the debug output from "kdebugdialog --fullmode" for http: kio_http(23476) HTTPProtocol::sendQuery: ============ Sending Header: kio_http(23476) HTTPProtocol::sendQuery: "GET / HTTP/1.1" kio_http(23476) HTTPProtocol::sendQuery: "Host: www.kde.org" kio_http(23476) HTTPProtocol::sendQuery: "Connection: keep-alive" kio_http(23476) HTTPProtocol::sendQuery: "User-Agent: Mozilla/5.0 (X11) KHTML/4.7.2 (like Gecko) Konqueror/4.7" kio_http(23476) HTTPProtocol::sendQuery: "Accept: text/html, text/*;q=0.9, image/jpeg;q=0.9, image/png;q=0.9, image/*;q=0.9, */*;q=0.8" kio_http(23476) HTTPProtocol::sendQuery: "Accept-Encoding: gzip, deflate, x-gzip, x-deflate" kio_http(23476) HTTPProtocol::sendQuery: "Accept-Charset: utf-8,*;q=0.5" kio_http(23476) HTTPProtocol::sendQuery: "Accept-Language: de,en-US;q=0.9,en;q=0.8" kio_http(23476) HTTPProtocol::readResponseHeader: ============ Received Status Response: kio_http(23476) HTTPProtocol::readResponseHeader: "HTTP/1.0 400 Bad Request" kio_http(23478) HTTPProtocol::sendQuery: ============ Sending Header: kio_http(23478) HTTPProtocol::sendQuery: "GET /favicon.ico HTTP/1.1" kio_http(23478) HTTPProtocol::sendQuery: "Host: www.kde.org" kio_http(23478) HTTPProtocol::sendQuery: "Connection: keep-alive" kio_http(23478) HTTPProtocol::sendQuery: "User-Agent: Mozilla/5.0 (X11) KHTML/4.7.2 (like Gecko) Konqueror/4.7" kio_http(23478) HTTPProtocol::sendQuery: "Pragma: no-cache" kio_http(23478) HTTPProtocol::sendQuery: "Cache-control: no-cache" kio_http(23478) HTTPProtocol::sendQuery: "Accept: text/html, text/*;q=0.9, image/jpeg;q=0.9, image/png;q=0.9, image/*;q=0.9, */*;q=0.8" kio_http(23478) HTTPProtocol::sendQuery: "Accept-Encoding: gzip, deflate, x-gzip, x-deflate" kio_http(23478) HTTPProtocol::sendQuery: "Accept-Charset: utf-8,*;q=0.5" kio_http(23478) HTTPProtocol::sendQuery: "Accept-Language: de,en-US;q=0.9,en;q=0.8" kio_http(23478) HTTPProtocol::readResponseHeader: ============ Received Status Response: kio_http(23478) HTTPProtocol::readResponseHeader: "HTTP/1.0 400 Bad Request" and here is my proxy.pac : function FindProxyForURL(url, host) { if (localHostOrDomainIs(host, "localhost")) return "DIRECT"; var noproxy = new Array("*enterprise.example.com*","*brz.example.com*"); for (p in noproxy) { if (shExpMatch(url, noproxy[p])) return "DIRECT"; } return "PROXY proxy.example.com:8080;DIRECT"; } Thanks for your support ! Best Regards Andi This issue is related only to proxy configuration file (proxy.pac). The proxy enviroment variables don't affect the behaviour in any ways (In reply to comment #3) > This issue is related only to proxy configuration file (proxy.pac). The proxy > enviroment variables don't affect the behaviour in any ways Right. Unless you setup Konqueror's proxy settings to use the system proxy settings, it won't use the environment variables you mentioned ; so that makes sense. The debug output you provided is only for debug area 7103 (kio_http). Please enable the other debug area 7113 (kio_http_debug) to get a more verbose output. It is most definitely incorrect for kio_http to send the GET header it is sending if it is using the proxy configuration in the PAC file you provided above. I hope I have the right debugging information this time. This is the debug record of one http request against bugs.kde.org using a proxy.pac from local filesystem: kio_http(18897)/kio_http_debug HTTPProtocol::reparseConfiguration: kio_http(18897)/kio_http_debug HTTPProtocol::setHost: Hostname is now: "bugs.kde.org" ( "bugs.kde.org" ) kio_http(18897)/kio_http_debug HTTPProtocol::get: "http://bugs.kde.org" kio_http(18897)/kio_http_debug HTTPProtocol::maybeSetRequestUrl: "http://bugs.kde.org" kio_http(18897)/kio_http_debug HTTPProtocol::get: "http://bugs.kde.org/" kio_http(18897)/kio_http_debug HTTPProtocol::maybeSetRequestUrl: "http://bugs.kde.org/" kio_http(18897)/kio_http_debug HTTPProtocol::resetSessionSettings: Window Id = "117440946" kio_http(18897)/kio_http_debug HTTPProtocol::resetSessionSettings: ssl_was_in_use = "" kio_http(18897)/kio_http_debug HTTPProtocol::proceedUntilResponseContent: kio_http(18897)/kio_http_debug HTTPProtocol::proceedUntilResponseHeader: kio_http(18897)/kio_http_debug HTTPProtocol::sendQuery: kio_http(18897)/kio_http_debug HTTPProtocol::httpShouldCloseConnection: kio_http(18897)/kio_http_debug HTTPProtocol::httpOpenConnection: kio_http(18897)/kio_http_debug HTTPProtocol::httpOpenConnection: Proxy URLs: ("https://pro-campus.example.com:8080", "DIRECT") kio_http(18897)/kio_http_debug HTTPProtocol::httpOpenConnection: Connecting to proxy: address= "https://pro-campus.example.com:8080" type= 2 kio_http(18897)/kio_http_debug HTTPProtocol::httpOpenConnection: Connected to proxy: host= "pro-campus.example.com" port= 8080 kio_http(18897)/kio_http_debug HTTPProtocol::satisfyRequestFromCache: kio_http(18897)/kio_http_debug HTTPProtocol::cacheFileOpenRead: kio_http(18897)/kio_http_debug HTTPProtocol::cacheFileClose: kio_http(18897)/kio_http_debug HTTPProtocol::sendQuery: sent it! kio_http(18897)/kio_http_debug HTTPProtocol::readResponseHeader: kio_http(18897)/kio_http_debug HTTPProtocol::readResponseHeader: wasAuthError= false isAuthError= false sameAuthError= false kio_http(18897)/kio_http_debug HTTPProtocol::readResponseHeader: -- full response: "HTTP/1.0 400 Bad Request Server: squid/2.7.STABLE6 Date: Tue, 18 Oct 2011 09:48:57 GMT Content-Type: text/html Content-Length: 1944 X-Squid-Error: ERR_INVALID_REQ 0 X-Cache: MISS from pro-c01.example.com Via: 1.0 pro-c01.example.com:8080 (squid/2.7.STABLE6) Connection: close" kio_http(18897)/kio_http_debug HTTPProtocol::readResponseHeader: Content-type: "text/html" kio_http(18897)/kio_http_debug HTTPProtocol::fixupResponseMimetype: before fixup "text/html" kio_http(18897)/kio_http_debug HTTPProtocol::fixupResponseMimetype: after fixup "text/html" kio_http(18897)/kio_http_debug HTTPProtocol::readResponseHeader: Emitting mimetype "text/html" kio_http(18897)/kio_http_debug HTTPProtocol::proceedUntilResponseHeader: Previous Response: 0 kio_http(18897)/kio_http_debug HTTPProtocol::proceedUntilResponseHeader: Current Response: 400 kio_http(18897)/kio_http_debug HTTPProtocol::readBody: "1944" bytes left. kio_http(18897)/kio_http_debug HTTPProtocol::readBody: EOD received! Left = "0" kio_http(18897)/kio_http_debug HTTPProtocol::cacheFileClose: kio_http(18897)/kio_http_debug HTTPProtocol::httpClose: keepAlive = false kio_http(18897)/kio_http_debug HTTPProtocol::cacheFileClose: kio_http(18897)/kio_http_debug HTTPProtocol::httpCloseConnection: kio_http(18897)/kio_http_debug HTTPProtocol::httpClose: keepAlive = false kio_http(18897)/kio_http_debug HTTPProtocol::cacheFileClose: kio_http(18897)/kio_http_debug HTTPProtocol::httpCloseConnection: kio_http(18776)/kio_http_debug HTTPProtocol::setHost: Hostname is now: "bugs.kde.org" ( "bugs.kde.org" ) kio_http(18776)/kio_http_debug HTTPProtocol::get: "http://bugs.kde.org/favicon.ico" kio_http(18776)/kio_http_debug HTTPProtocol::maybeSetRequestUrl: "http://bugs.kde.org/favicon.ico" kio_http(18776)/kio_http_debug HTTPProtocol::resetSessionSettings: Window Id = "" kio_http(18776)/kio_http_debug HTTPProtocol::resetSessionSettings: ssl_was_in_use = "" kio_http(18776)/kio_http_debug HTTPProtocol::proceedUntilResponseContent: kio_http(18776)/kio_http_debug HTTPProtocol::proceedUntilResponseHeader: kio_http(18776)/kio_http_debug HTTPProtocol::sendQuery: kio_http(18776)/kio_http_debug HTTPProtocol::httpShouldCloseConnection: kio_http(18776)/kio_http_debug HTTPProtocol::httpOpenConnection: kio_http(18776)/kio_http_debug HTTPProtocol::httpOpenConnection: Proxy URLs: ("https://pro-campus.example.com:8080", "DIRECT") kio_http(18776)/kio_http_debug HTTPProtocol::httpOpenConnection: Connecting to proxy: address= "https://pro-campus.example.com:8080" type= 2 kio_http(18776)/kio_http_debug HTTPProtocol::httpOpenConnection: Connected to proxy: host= "pro-campus.example.com" port= 8080 kio_http(18776)/kio_http_debug HTTPProtocol::satisfyRequestFromCache: kio_http(18776)/kio_http_debug HTTPProtocol::sendQuery: sent it! kio_http(18776)/kio_http_debug HTTPProtocol::readResponseHeader: kio_http(18776)/kio_http_debug HTTPProtocol::httpClose: keepAlive = false kio_http(18776)/kio_http_debug HTTPProtocol::cacheFileClose: kio_http(18776)/kio_http_debug HTTPProtocol::httpCloseConnection: kio_http(18776)/kio_http_debug HTTPProtocol::cacheFileClose: kio_http(18776)/kio_http_debug HTTPProtocol::httpClose: keepAlive = false kio_http(18776)/kio_http_debug HTTPProtocol::cacheFileClose: kio_http(18776)/kio_http_debug HTTPProtocol::httpCloseConnection: I don't understand where kio_http found the following: kio_http(18897)/kio_http_debug HTTPProtocol::httpOpenConnection: Proxy URLs: ("https://pro-campus.example.com:8080", "DIRECT") kio_http(18897)/kio_http_debug HTTPProtocol::httpOpenConnection: Connecting to proxy: address= "https://pro-campus.example.com:8080" type= 2 I do not have any proxy configuration which enforces https as proxy protocol. Please compare with the proxy configuration script above. (In reply to comment #6) > I don't understand where kio_http found the following: > > kio_http(18897)/kio_http_debug HTTPProtocol::httpOpenConnection: Proxy URLs: > ("https://pro-campus.example.com:8080", "DIRECT") > kio_http(18897)/kio_http_debug HTTPProtocol::httpOpenConnection: Connecting to > proxy: address= "https://pro-campus.example.com:8080" type= 2 > > I do not have any proxy configuration which enforces https as proxy protocol. > Please compare with the proxy configuration script above. Hmm... indeed. It must be a logic error in the proxyscout library that handles PAC files. Will look into it shortly. Git commit 56a4c56a134fee7334cecb5ae8b27a37f8060e66 by Dawit Alemayehu. Committed on 18/10/2011 at 12:53. Pushed by adawit into branch 'KDE/4.7'. Append http not https to the address specified through the PROXY keyword. BUG: 283794 FIXED-IN: 4.7.3 M +1 -1 kio/misc/kpac/proxyscout.cpp http://commits.kde.org/kdelibs/56a4c56a134fee7334cecb5ae8b27a37f8060e66 *** Bug 284427 has been marked as a duplicate of this bug. *** *** Bug 284763 has been marked as a duplicate of this bug. *** *** Bug 284999 has been marked as a duplicate of this bug. *** |