Bug 55767 - [Qt] Two http auth tests fail with Qt 4.7.2
Summary: [Qt] Two http auth tests fail with Qt 4.7.2
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P1 Critical
Assignee: Nobody
URL:
Keywords: Qt, QtTriaged
Depends on:
Blocks: 62929
  Show dependency treegraph
 
Reported: 2011-03-04 04:33 PST by Csaba Osztrogonác
Modified: 2012-02-21 05:55 PST (History)
8 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Csaba Osztrogonác 2011-03-04 04:33:46 PST
The following tests pass with Qt 4.7.1, but fail with Qt 4.7.2:
http/tests/appcache/auth.html
http/tests/xmlhttprequest/basic-auth.html

pretty diffs:
http://build.webkit.org/results/Qt%20Linux%20Release/r80342%20%2829298%29/http/tests/appcache/auth-pretty-diff.html
http://build.webkit.org/results/Qt%20Linux%20Release/r80342%20%2829298%29/http/tests/xmlhttprequest/basic-auth-pretty-diff.html
Comment 1 Csaba Osztrogonác 2011-03-04 04:37:50 PST
I added them to the Skipped list to make buildbot happy: http://trac.webkit.org/changeset/80343
Comment 2 Joe Wild 2011-03-21 12:45:06 PDT
I'll take a look at this one.
Comment 3 Joe Wild 2011-03-22 13:11:15 PDT
It looks like the user and password authentication info is not getting
through in Qt 4.7.2.  They are added to the URL as in

  http://login:pasword@localhost/t/LayoutTests/http/tests/appcache/resources/auth/setup.php

but they are not added to the Authorization HTTP header as

  GET /t/LayoutTests/http/tests/appcache/resources/auth/setup.php HTTP/1.1
  ...
  Authorization: Basic bG9naW46cGFzd29yZA==


This fetch fails with a 401 Unauthorized error.
If I force the Authorization header this fetch succeeds.  Then the next
fetch to iframe.php gets an 401 failure.  I assume that
means that this info needs tqo be saved and send with following requests.

Anyway, I think I need to investigate how this worked in Qt 4.7.1 since
there seem to be several possibilities on how this should be fixed.
Comment 4 Joe Wild 2011-03-23 14:01:42 PDT
Just wanted to add that I see very different behavior.  In Qt 4.7.1 the first
fetch that requires authentication fails and then another fetch with the
Authorization headers succeeds.  In 4.7.2, the 1st just fails.

I also see changes in the state machine.  This state is not in 4.7.2
case QHttpNetworkConnectionChannel::Wait4AuthState:

I think the next place for me to debug in here.

// handles the authentication for one channel and eventually re-starts the other channels
bool QHttpNetworkConnectionPrivate::handleAuthenticateChallenge(QAbstractSocket *socket, QHttpNetworkReply *reply,
                                                                bool isProxy, bool &resend)
{
Comment 5 Joe Wild 2011-03-24 17:26:36 PDT
What I am seeing is that the same socket is used for the 2nd request with the Authorization headers.  However the socket stays in the Unconnected state and never makes the transition to Connected.  Therefore this request times out.
I don't know why this gets stuck here, but will dig deeper.  Maybe a missing signal.
Comment 6 Joe Wild 2011-03-28 08:24:45 PDT
This seems to be a problem in Qt 4.7.2 HTTP/Socket code.  Entered the following error for it.

QTBUG-18411 - Qt 4.7.2 fails to add HTTP Authorization header and refetch after 401 
http://bugreports.qt.nokia.com/browse/QTBUG-18411
Comment 7 Benjamin Poulain 2011-04-06 11:56:17 PDT
(In reply to comment #6)
> This seems to be a problem in Qt 4.7.2 HTTP/Socket code.  Entered the following error for it.
> 
> QTBUG-18411 - Qt 4.7.2 fails to add HTTP Authorization header and refetch after 401 
> http://bugreports.qt.nokia.com/browse/QTBUG-18411

Thanks for investigating.

I add Markus and Peter in CC. Hopefully they have an idea of what have changed.
Comment 8 Joel Parks 2011-06-27 13:15:14 PDT
requested priority upgrade and ETA on http://bugreports.qt.nokia.com/browse/QTBUG-18411
Comment 9 João Paulo Rechi Vita 2011-12-22 11:33:22 PST
http/tests/appcache/auth.html has been moved to the Qt-4.8 skip list on http://trac.webkit.org/changeset/103504

More info can be found on bug https://bugs.webkit.org/show_bug.cgi?id=74960
Comment 10 Csaba Osztrogonác 2012-02-21 05:55:10 PST
http/tests/appcache/auth.html works with Qt 4.8 and Qt 5.0 too, I unskipped it - http://trac.webkit.org/changeset/108346/trunk/LayoutTests/platform/qt-4.8/Skipped

And http/tests/xmlhttprequest/basic-auth.html fails only on qt-5.0-wk2 because of other reason, so we can close this bug.