WebKit Bugzilla
Attachment 369257 Details for
Bug 197650
: [Curl] Suppress extra didReceiveAuthenticationChallenge call when accessing a server which checks basic auth.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-197650-20190507173930.patch (text/plain), 7.42 KB, created by
Takashi Komori
on 2019-05-07 01:42:12 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Takashi Komori
Created:
2019-05-07 01:42:12 PDT
Size:
7.42 KB
patch
obsolete
>Subversion Revision: 244918 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 144e79b4ccc0390cb728bd96fcf2bf7fa9a9c27a..01472912ee28c61b045265c8c6fb2260f553ad07 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,15 @@ >+2019-05-07 Takashi Komori <Takashi.Komori@sony.com> >+ >+ [Curl] Suppress extra didReceiveAuthenticationChallenge call when accessing a server which checks basic auth. >+ https://bugs.webkit.org/show_bug.cgi?id=197650 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Test: http/tests/misc/certificate-and-authentication.html >+ >+ * platform/network/curl/CurlRequest.h: >+ (WebCore::CurlRequest::isServerTrustEvaluationDisabled): >+ > 2019-05-03 Youenn Fablet <youenn@apple.com> > > Cache.add and Cache.addAll should compute a correct response body size >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 5200b51b836528df35780edb583d3e620476336f..62605e7bba66cb25069461bb84d2dd3268f0a5c8 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,13 @@ >+2019-05-07 Takashi Komori <Takashi.Komori@sony.com> >+ >+ [Curl] Suppress extra didReceiveAuthenticationChallenge call when accessing a server which checks basic auth. >+ https://bugs.webkit.org/show_bug.cgi?id=197650 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * NetworkProcess/curl/NetworkDataTaskCurl.cpp: >+ (WebKit::NetworkDataTaskCurl::restartWithCredential): >+ > 2019-05-03 Brent Fulgham <bfulgham@apple.com> > > Use more efficient path resolution logic >diff --git a/Source/WebCore/platform/network/curl/CurlRequest.h b/Source/WebCore/platform/network/curl/CurlRequest.h >index d13766e3bf4e3b025b8e8784f2109fb1355b8c28..91d4dc9b057656d86426a1f4d9df40790129d697 100644 >--- a/Source/WebCore/platform/network/curl/CurlRequest.h >+++ b/Source/WebCore/platform/network/curl/CurlRequest.h >@@ -74,6 +74,7 @@ public: > void invalidateClient(); > WEBCORE_EXPORT void setAuthenticationScheme(ProtectionSpaceAuthenticationScheme); > WEBCORE_EXPORT void setUserPass(const String&, const String&); >+ bool isServerTrustEvaluationDisabled() { return m_shouldDisableServerTrustEvaluation; } > void disableServerTrustEvaluation() { m_shouldDisableServerTrustEvaluation = true; } > void setStartTime(const MonotonicTime& startTime) { m_requestStartTime = startTime; } > >diff --git a/Source/WebKit/NetworkProcess/curl/NetworkDataTaskCurl.cpp b/Source/WebKit/NetworkProcess/curl/NetworkDataTaskCurl.cpp >index 36a6b3926c1b2a868d807f14738ed968dbd2cc6b..77633ba44822e4bbc82ce3cb27f724af9679d350 100644 >--- a/Source/WebKit/NetworkProcess/curl/NetworkDataTaskCurl.cpp >+++ b/Source/WebKit/NetworkProcess/curl/NetworkDataTaskCurl.cpp >@@ -425,12 +425,13 @@ void NetworkDataTaskCurl::restartWithCredential(const ProtectionSpace& protectio > ASSERT(m_curlRequest); > > auto previousRequest = m_curlRequest->resourceRequest(); >+ auto shouldDisableServerTrustEvaluation = protectionSpace.authenticationScheme() == ProtectionSpaceAuthenticationSchemeServerTrustEvaluationRequested || m_curlRequest->isServerTrustEvaluationDisabled(); > m_curlRequest->cancel(); > > m_curlRequest = createCurlRequest(WTFMove(previousRequest), RequestStatus::ReusedRequest); > m_curlRequest->setAuthenticationScheme(protectionSpace.authenticationScheme()); > m_curlRequest->setUserPass(credential.user(), credential.password()); >- if (protectionSpace.authenticationScheme() == ProtectionSpaceAuthenticationSchemeServerTrustEvaluationRequested) >+ if (shouldDisableServerTrustEvaluation) > m_curlRequest->disableServerTrustEvaluation(); > m_curlRequest->setStartTime(m_startTime); > m_curlRequest->start(); >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index beb63bc2b73e800ee6fd61bea0f4a774745dc7bc..6d68652b3499e265a51a2bc958e174ff13ecfc67 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,14 @@ >+2019-05-07 Takashi Komori <Takashi.Komori@sony.com> >+ >+ [Curl] Suppress extra didReceiveAuthenticationChallenge call when accessing a server which checks basic auth. >+ https://bugs.webkit.org/show_bug.cgi?id=197650 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * http/tests/misc/certificate-and-authentication-expected.txt: Added. >+ * http/tests/misc/certificate-and-authentication.html: Added. >+ * http/tests/misc/resources/certificate-and-authentication.php: Added. >+ > 2019-05-03 Youenn Fablet <youenn@apple.com> > > Cache.add and Cache.addAll should compute a correct response body size >diff --git a/LayoutTests/http/tests/misc/certificate-and-authentication-expected.txt b/LayoutTests/http/tests/misc/certificate-and-authentication-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..d474190b6dc12151aff4c800f6592a0d602ea20d >--- /dev/null >+++ b/LayoutTests/http/tests/misc/certificate-and-authentication-expected.txt >@@ -0,0 +1,4 @@ >+localhost:8443 - didReceiveAuthenticationChallenge - ProtectionSpaceAuthenticationSchemeHTTPBasic - Responding with user:pass >+PASS >+ >+ >diff --git a/LayoutTests/http/tests/misc/certificate-and-authentication.html b/LayoutTests/http/tests/misc/certificate-and-authentication.html >new file mode 100644 >index 0000000000000000000000000000000000000000..336924bd112dda2907ffc4132e7a3dfb7835fb2c >--- /dev/null >+++ b/LayoutTests/http/tests/misc/certificate-and-authentication.html >@@ -0,0 +1,41 @@ >+<html> >+<head> >+<!-- This is a test for https://bugs.webkit.org/show_bug.cgi?id=197650 --> >+<script> >+var currentCallbackCounts = 0; >+ >+function runTest() { >+ if (window.testRunner) { >+ testRunner.waitUntilDone(); >+ testRunner.dumpAsText(); >+ testRunner.setAllowsAnySSLCertificate(true); >+ testRunner.setHandlesAuthenticationChallenges(true); >+ testRunner.setAuthenticationUsername("user"); >+ testRunner.setAuthenticationPassword("pass"); >+ >+ currentCallbackCounts = testRunner.serverTrustEvaluationCallbackCallsCount; >+ } >+ >+ var iframe = document.createElement("iframe"); >+ iframe.src = "https://localhost:8443/misc/resources/certificate-and-authentication.php"; >+ document.body.appendChild(iframe); >+} >+ >+window.onmessage = function() { >+ if (window.testRunner) { >+ var callbackCounts = testRunner.serverTrustEvaluationCallbackCallsCount - currentCallbackCounts; >+ >+ if (callbackCounts == 1) >+ document.getElementById('result').innerText = "PASS"; >+ else >+ document.getElementById('result').innerText = "FAIL (" + callbackCounts + ")"; >+ >+ testRunner.notifyDone(); >+ } >+} >+</script> >+</head> >+<body onload="runTest()"> >+<p id="result">RUNNING</p> >+</body> >+</html> >diff --git a/LayoutTests/http/tests/misc/resources/certificate-and-authentication.php b/LayoutTests/http/tests/misc/resources/certificate-and-authentication.php >new file mode 100644 >index 0000000000000000000000000000000000000000..bf34e282987ebe8b115abbc83b3d62aac44f6326 >--- /dev/null >+++ b/LayoutTests/http/tests/misc/resources/certificate-and-authentication.php >@@ -0,0 +1,14 @@ >+<?php >+ header("Cache-Control: no-cache, no-store"); >+ >+ if (!isset($_SERVER['PHP_AUTH_USER']) || !isset($_SERVER['PHP_AUTH_PW']) || $_SERVER['PHP_AUTH_USER'] != 'user' || $_SERVER['PHP_AUTH_PW'] != 'pass') { >+ header('WWW-Authenticate: Basic realm="WebKit test - certificate-and-authentication"'); >+ header('HTTP/1.0 401 Unauthorized'); >+ exit; >+ } >+?> >+ >+<!DOCTYPE html> >+<script> >+parent.postMessage("loaded", "*"); >+</script>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 197650
:
369257
|
369262
|
369265
|
369269
|
369270
|
369272
|
369456
|
369459
|
369469
|
369540
|
369649