Unreviewed, rolling out r249001.
authorryanhaddad@apple.com <ryanhaddad@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Aug 2019 20:23:21 +0000 (20:23 +0000)
committerryanhaddad@apple.com <ryanhaddad@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Aug 2019 20:23:21 +0000 (20:23 +0000)
Caused one layout test to fail on all configurations and
another to time out on Catalina / iOS 13.

Reverted changeset:

"Add a WebsiteDataStore delegate to handle
AuthenticationChallenge that do not come from pages"
https://bugs.webkit.org/show_bug.cgi?id=196870
https://trac.webkit.org/changeset/249001

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@249063 268f45cc-cd09-0410-ab3c-d52691b4dbfc

39 files changed:
LayoutTests/ChangeLog
LayoutTests/http/wpt/beacon/cors/crossorigin-arraybufferview-no-preflight-expected.txt
LayoutTests/http/wpt/beacon/cors/crossorigin-arraybufferview-no-preflight.html
LayoutTests/http/wpt/beacon/resources/beacon-preflight.py
LayoutTests/http/wpt/service-workers/resources/lengthy-pass.py
LayoutTests/http/wpt/service-workers/server-trust-evaluation.https-expected.txt [deleted file]
LayoutTests/http/wpt/service-workers/server-trust-evaluation.https.html [deleted file]
LayoutTests/http/wpt/service-workers/server-trust-worker.js [deleted file]
Source/WebKit/ChangeLog
Source/WebKit/NetworkProcess/NetworkCORSPreflightChecker.cpp
Source/WebKit/NetworkProcess/NetworkDataTask.cpp
Source/WebKit/NetworkProcess/NetworkDataTask.h
Source/WebKit/NetworkProcess/NetworkLoad.cpp
Source/WebKit/NetworkProcess/NetworkLoadChecker.h
Source/WebKit/NetworkProcess/PingLoad.cpp
Source/WebKit/Shared/Authentication/AuthenticationManager.cpp
Source/WebKit/Shared/Authentication/AuthenticationManager.h
Source/WebKit/Shared/Authentication/cocoa/AuthenticationChallengeDispositionCocoa.h [deleted file]
Source/WebKit/Shared/Authentication/cocoa/AuthenticationChallengeDispositionCocoa.mm [deleted file]
Source/WebKit/SourcesCocoa.txt
Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.mm
Source/WebKit/UIProcess/API/Cocoa/_WKWebsiteDataStoreDelegate.h
Source/WebKit/UIProcess/Cocoa/NavigationState.mm
Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp
Source/WebKit/UIProcess/Network/NetworkProcessProxy.h
Source/WebKit/UIProcess/Network/NetworkProcessProxy.messages.in
Source/WebKit/UIProcess/ServiceWorkerProcessProxy.cpp
Source/WebKit/UIProcess/ServiceWorkerProcessProxy.h
Source/WebKit/UIProcess/WebPageProxy.cpp
Source/WebKit/UIProcess/WebProcessPool.cpp
Source/WebKit/UIProcess/WebProcessPool.h
Source/WebKit/UIProcess/WebsiteData/WebsiteDataStoreClient.h
Source/WebKit/WebKit.xcodeproj/project.pbxproj
Tools/ChangeLog
Tools/WebKitTestRunner/TestController.cpp
Tools/WebKitTestRunner/TestController.h
Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm
Tools/WebKitTestRunner/cocoa/TestWebsiteDataStoreDelegate.h
Tools/WebKitTestRunner/cocoa/TestWebsiteDataStoreDelegate.mm

index 64e5dbf..5fa862d 100644 (file)
@@ -1,3 +1,17 @@
+2019-08-23  Ryan Haddad  <ryanhaddad@apple.com>
+
+        Unreviewed, rolling out r249001.
+
+        Caused one layout test to fail on all configurations and
+        another to time out on Catalina / iOS 13.
+
+        Reverted changeset:
+
+        "Add a WebsiteDataStore delegate to handle
+        AuthenticationChallenge that do not come from pages"
+        https://bugs.webkit.org/show_bug.cgi?id=196870
+        https://trac.webkit.org/changeset/249001
+
 2019-08-23  Antoine Quint  <graouts@apple.com>
 
         REGRESSION: fast/events/pointer/ios/drag-gives-pointerdown-pointermove-pointerup.html is timing out
index 8b5a820..fa4860b 100644 (file)
@@ -26,33 +26,12 @@ function pollResult(test, id) {
   });
 }
 
-function testCORSPreflight(what) {
-  var testBase = get_host_info().HTTPS_REMOTE_ORIGIN + RESOURCES_DIR;
-
-  promise_test(async function(test) {
-    var id = "ca33c073-1cf0-41e5-bbd4-55969fb1a6c7";
-    var testUrl = testBase + "beacon-preflight.py?allowCors=1&cmd=put&id=" + id;
-    if (window.testRunner) {
-      window.testRunner.setAllowsAnySSLCertificate(false);
-      window.testRunner.terminateNetworkProcess();
-      await fetch("").then(() => { }, () => { });
-    }
-
-    assert_true(navigator.sendBeacon(testUrl, what), "sendBeacon succeeded");
-    const result = await pollResult(test, id);
-    assert_equals(result['preflight'], 0, "Did not receive CORS preflight")
-    assert_equals(result['beacon'], 0, "Did not receive beacon")
-  }, "Beacon load should not be sent if server is not trusted.");
-
-  promise_test(async function(test) {
-    var id = self.token();
-    var testUrl = testBase + "beacon-preflight.py?allowCors=1&cmd=put&id=" + id;
-    if (window.testRunner) {
-      window.testRunner.setAllowsAnySSLCertificate(true);
-      window.testRunner.terminateNetworkProcess();
-      await fetch("").then(() => { }, () => { });
-    }
+function testCORSPreflightSuccess(what) {
+  var testBase = get_host_info().HTTP_REMOTE_ORIGIN + RESOURCES_DIR;
+  var id = self.token();
+  var testUrl = testBase + "beacon-preflight.py?allowCors=1&cmd=put&id=" + id;
 
+  promise_test(function(test) {
     assert_true(navigator.sendBeacon(testUrl, what), "SendBeacon Succeeded");
     return pollResult(test, id) .then(result => {
       assert_equals(result['preflight'], 0, "Did not receive CORS preflight")
@@ -72,7 +51,7 @@ function stringToArrayBufferView(input) {
   return view;
 }
 
-testCORSPreflight(stringToArrayBufferView("123"));
+testCORSPreflightSuccess(stringToArrayBufferView("123"));
     </script>
   </body>
 </html>
index 25e83fe..1d49cf3 100644 (file)
@@ -44,9 +44,11 @@ def main(request, response):
       stashed_data['beacon_origin'] = request.headers.get("Origin", "")
       request.server.stash.put(test_id, stashed_data)
     return [("Content-Type", "text/plain")], ""
-
+  
   if command == "get":
-    return [("Content-Type", "text/plain")], json.dumps(stashed_data)
+    if stashed_data is not None:
+      return [("Content-Type", "text/plain")], json.dumps(stashed_data)
+    return [("Content-Type", "text/plain")], ""
 
   response.set_error(400, "Bad Command")
   return [("Content-Type", "text/plain")], "ERROR: Bad Command!"
index 04ef57a..962a4dc 100644 (file)
@@ -3,7 +3,6 @@ import time
 def main(request, response):
     delay = 0.05
     response.headers.set("Content-type", "text/javascript")
-    response.headers.append("Access-Control-Allow-Origin", "*")
     response.write_status_headers()
     time.sleep(delay);
     response.writer.write_content("document")
diff --git a/LayoutTests/http/wpt/service-workers/server-trust-evaluation.https-expected.txt b/LayoutTests/http/wpt/service-workers/server-trust-evaluation.https-expected.txt
deleted file mode 100644 (file)
index 0b48df4..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-
-PASS Setup worker 
-PASS Service worker load should fail 
-PASS Service worker load should succeed 
-
diff --git a/LayoutTests/http/wpt/service-workers/server-trust-evaluation.https.html b/LayoutTests/http/wpt/service-workers/server-trust-evaluation.https.html
deleted file mode 100644 (file)
index 0ba2f33..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-<html>
-<head>
-<title>Service Worker triggering server trust evaluation</title>
-<script src="/resources/testharness.js"></script>
-<script src="/resources/testharnessreport.js"></script>
-<script src="/service-workers/service-worker/resources/test-helpers.sub.js"></script>
-</head>
-<body>
-<script>
-var registration;
-var iframe;
-promise_test(async (test) => {
-    if (window.testRunner) {
-        window.testRunner.terminateNetworkProcess();
-        await fetch("").then(() => { }, () => { });
-    }
-
-    registration = await navigator.serviceWorker.getRegistration("resources/");
-    if (registration)
-        await registration.unregister();
-    registration = await navigator.serviceWorker.register("server-trust-worker.js", { scope : "resources/" });
-    activeWorker = registration.active;
-    if (activeWorker)
-        return;
-    activeWorker = registration.installing;
-    await new Promise(resolve => {
-        activeWorker.addEventListener('statechange', () => {
-            if (activeWorker.state === "activated")
-                resolve();
-        });
-    });
-}, "Setup worker");
-
-promise_test(async (test) => {
-    if (window.testRunner)
-        window.testRunner.setAllowsAnySSLCertificate(false);
-
-    iframe = await with_iframe("resources/iframe1.html");
-    assert_true(iframe.contentWindow.document.body.innerHTML.trim().indexOf("Load failed: ") !== -1);
-    iframe.remove();
-}, "Service worker load should fail");
-
-promise_test(async (test) => {
-    if (window.testRunner)
-        window.testRunner.setAllowsAnySSLCertificate(true);
-
-    iframe = await with_iframe("resources/iframe2.html");
-    assert_true(iframe.contentWindow.document.body.innerHTML.trim().indexOf("PASS") !== -1);
-    iframe.remove();
-}, "Service worker load should succeed");
-</script>
-</body>
-</html>
diff --git a/LayoutTests/http/wpt/service-workers/server-trust-worker.js b/LayoutTests/http/wpt/service-workers/server-trust-worker.js
deleted file mode 100644 (file)
index 330c889..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-var remoteUrl = 'https://127.0.0.1:9443/WebKit/service-workers/resources/lengthy-pass.py?';
-var counter = 0;
-self.addEventListener('fetch', (event) => {
-    event.respondWith(fetch(remoteUrl + counter++).then(response => new Response("PASS")).catch(e => new Response("Load failed: " + e)));
-});
index c844b4e..5bd65b8 100644 (file)
@@ -1,3 +1,17 @@
+2019-08-23  Ryan Haddad  <ryanhaddad@apple.com>
+
+        Unreviewed, rolling out r249001.
+
+        Caused one layout test to fail on all configurations and
+        another to time out on Catalina / iOS 13.
+
+        Reverted changeset:
+
+        "Add a WebsiteDataStore delegate to handle
+        AuthenticationChallenge that do not come from pages"
+        https://bugs.webkit.org/show_bug.cgi?id=196870
+        https://trac.webkit.org/changeset/249001
+
 2019-08-23  Brian Burg  <bburg@apple.com>
 
         REGRESSION(r248713): WebDriver commands which target the implicit main frame now hit an ASSERT
index 0798799..4adf1d3 100644 (file)
@@ -101,7 +101,7 @@ void NetworkCORSPreflightChecker::didReceiveChallenge(WebCore::AuthenticationCha
         return;
     }
 
-    m_networkProcess->authenticationManager().didReceiveAuthenticationChallenge(m_parameters.sessionID, m_parameters.pageID, m_parameters.frameID, challenge, WTFMove(completionHandler));
+    m_networkProcess->authenticationManager().didReceiveAuthenticationChallenge(m_parameters.pageID, m_parameters.frameID, challenge, WTFMove(completionHandler));
 }
 
 void NetworkCORSPreflightChecker::didReceiveResponse(WebCore::ResourceResponse&& response, ResponseCompletionHandler&& completionHandler)
index 7a247a4..8b3bce9 100644 (file)
@@ -150,9 +150,4 @@ String NetworkDataTask::description() const
     return emptyString();
 }
 
-PAL::SessionID NetworkDataTask::sessionID() const
-{
-    return m_session->sessionID();
-}
-
 } // namespace WebKit
index 9a984e8..09e3aa6 100644 (file)
@@ -34,7 +34,6 @@
 #include <WebCore/ResourceRequest.h>
 #include <WebCore/StoredCredentialsPolicy.h>
 #include <WebCore/Timer.h>
-#include <pal/SessionID.h>
 #include <wtf/CompletionHandler.h>
 #include <wtf/ThreadSafeRefCounted.h>
 #include <wtf/text/WTFString.h>
@@ -131,8 +130,6 @@ public:
 
     virtual String description() const;
 
-    PAL::SessionID sessionID() const;
-
 protected:
     NetworkDataTask(NetworkSession&, NetworkDataTaskClient&, const WebCore::ResourceRequest&, WebCore::StoredCredentialsPolicy, bool shouldClearReferrerOnHTTPSToHTTPRedirect, bool dataTaskIsForMainFrameNavigation);
 
index ecdf705..ee80ac6 100644 (file)
@@ -201,7 +201,7 @@ void NetworkLoad::didReceiveChallenge(AuthenticationChallenge&& challenge, Chall
     if (auto* pendingDownload = m_task->pendingDownload())
         m_networkProcess->authenticationManager().didReceiveAuthenticationChallenge(*pendingDownload, challenge, WTFMove(completionHandler));
     else
-        m_networkProcess->authenticationManager().didReceiveAuthenticationChallenge(m_task->sessionID(), m_parameters.webPageID, m_parameters.webFrameID, challenge, WTFMove(completionHandler));
+        m_networkProcess->authenticationManager().didReceiveAuthenticationChallenge(m_parameters.webPageID, m_parameters.webFrameID, challenge, WTFMove(completionHandler));
 }
 
 void NetworkLoad::didReceiveResponse(ResourceResponse&& response, ResponseCompletionHandler&& completionHandler)
index 3273b12..ec94e14 100644 (file)
@@ -84,8 +84,6 @@ public:
     }
 #endif
 
-    NetworkProcess& networkProcess() { return m_networkProcess; }
-
     const URL& url() const { return m_url; }
     WebCore::StoredCredentialsPolicy storedCredentialsPolicy() const { return m_storedCredentialsPolicy; }
 
index 602d36b..fe8f03a 100644 (file)
@@ -148,7 +148,7 @@ void PingLoad::didReceiveChallenge(AuthenticationChallenge&& challenge, Challeng
 {
     RELEASE_LOG_IF_ALLOWED("didReceiveChallenge");
     if (challenge.protectionSpace().authenticationScheme() == ProtectionSpaceAuthenticationSchemeServerTrustEvaluationRequested) {
-        m_networkLoadChecker->networkProcess().authenticationManager().didReceiveAuthenticationChallenge(m_parameters.sessionID, m_parameters.webPageID, m_parameters.webFrameID, challenge, WTFMove(completionHandler));
+        completionHandler(AuthenticationChallengeDisposition::PerformDefaultHandling, { });
         return;
     }
     auto weakThis = makeWeakPtr(*this);
index 5caa1cc..38a5bff 100644 (file)
@@ -108,7 +108,7 @@ Vector<uint64_t> AuthenticationManager::coalesceChallengesMatching(uint64_t chal
     return challengesToCoalesce;
 }
 
-void AuthenticationManager::didReceiveAuthenticationChallenge(PAL::SessionID sessionID, PageIdentifier pageID, FrameIdentifier frameID, const AuthenticationChallenge& authenticationChallenge, ChallengeCompletionHandler&& completionHandler)
+void AuthenticationManager::didReceiveAuthenticationChallenge(PageIdentifier pageID, FrameIdentifier frameID, const AuthenticationChallenge& authenticationChallenge, ChallengeCompletionHandler&& completionHandler)
 {
     ASSERT(pageID);
     ASSERT(frameID);
@@ -119,7 +119,7 @@ void AuthenticationManager::didReceiveAuthenticationChallenge(PAL::SessionID ses
     if (shouldCoalesceChallenge(pageID, challengeID, authenticationChallenge))
         return;
     
-    m_process.send(Messages::NetworkProcessProxy::DidReceiveAuthenticationChallenge(sessionID, pageID, frameID, authenticationChallenge, challengeID));
+    m_process.send(Messages::NetworkProcessProxy::DidReceiveAuthenticationChallenge(pageID, frameID, authenticationChallenge, challengeID));
 }
 
 void AuthenticationManager::didReceiveAuthenticationChallenge(IPC::MessageSender& download, const WebCore::AuthenticationChallenge& authenticationChallenge, ChallengeCompletionHandler&& completionHandler)
index 8b3f86e..2377312 100644 (file)
@@ -63,7 +63,7 @@ public:
 
     static const char* supplementName();
 
-    void didReceiveAuthenticationChallenge(PAL::SessionID, WebCore::PageIdentifier, WebCore::FrameIdentifier, const WebCore::AuthenticationChallenge&, ChallengeCompletionHandler&&);
+    void didReceiveAuthenticationChallenge(WebCore::PageIdentifier, WebCore::FrameIdentifier, const WebCore::AuthenticationChallenge&, ChallengeCompletionHandler&&);
     void didReceiveAuthenticationChallenge(IPC::MessageSender& download, const WebCore::AuthenticationChallenge&, ChallengeCompletionHandler&&);
 
     void completeAuthenticationChallenge(uint64_t challengeID, AuthenticationChallengeDisposition, WebCore::Credential&&);
diff --git a/Source/WebKit/Shared/Authentication/cocoa/AuthenticationChallengeDispositionCocoa.h b/Source/WebKit/Shared/Authentication/cocoa/AuthenticationChallengeDispositionCocoa.h
deleted file mode 100644 (file)
index f49258a..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-  /*
- * Copyright (C) 2019 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#pragma once
-
-#import "AuthenticationChallengeDisposition.h"
-#import <Foundation/NSURLSession.h>
-
-namespace WebKit {
-
-AuthenticationChallengeDisposition toAuthenticationChallengeDisposition(NSURLSessionAuthChallengeDisposition);
-
-} // namespace WebKit
diff --git a/Source/WebKit/Shared/Authentication/cocoa/AuthenticationChallengeDispositionCocoa.mm b/Source/WebKit/Shared/Authentication/cocoa/AuthenticationChallengeDispositionCocoa.mm
deleted file mode 100644 (file)
index 8fa4661..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (C) 2018-2019 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "AuthenticationChallengeDispositionCocoa.h"
-
-namespace WebKit {
-
-AuthenticationChallengeDisposition toAuthenticationChallengeDisposition(NSURLSessionAuthChallengeDisposition disposition)
-{
-    switch (disposition) {
-    case NSURLSessionAuthChallengeUseCredential:
-        return AuthenticationChallengeDisposition::UseCredential;
-    case NSURLSessionAuthChallengePerformDefaultHandling:
-        return AuthenticationChallengeDisposition::PerformDefaultHandling;
-    case NSURLSessionAuthChallengeCancelAuthenticationChallenge:
-        return AuthenticationChallengeDisposition::Cancel;
-    case NSURLSessionAuthChallengeRejectProtectionSpace:
-        return AuthenticationChallengeDisposition::RejectProtectionSpaceAndContinue;
-    }
-    [NSException raise:NSInvalidArgumentException format:@"Invalid NSURLSessionAuthChallengeDisposition (%ld)", (long)disposition];
-}
-
-} // namespace WebKit
index 0f63789..bd995e9 100644 (file)
@@ -133,7 +133,6 @@ Shared/cf/CookieStorageUtilsCF.mm
 
 Shared/cg/ShareableBitmapCG.cpp
 
-Shared/Authentication/cocoa/AuthenticationChallengeDispositionCocoa.mm
 Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm
 Shared/Authentication/cocoa/ClientCertificateAuthenticationXPCConstants.cpp
 
index ac7e49a..9a28334 100644 (file)
 #import "WKWebsiteDataStoreInternal.h"
 
 #import "APIString.h"
-#import "AuthenticationChallengeDispositionCocoa.h"
 #import "CompletionHandlerCallChecker.h"
 #import "WKHTTPCookieStoreInternal.h"
 #import "WKNSArray.h"
-#import "WKNSURLAuthenticationChallenge.h"
 #import "WKWebViewInternal.h"
 #import "WKWebsiteDataRecordInternal.h"
 #import "WebPageProxy.h"
@@ -40,7 +38,6 @@
 #import "WebsiteDataFetchOption.h"
 #import "_WKWebsiteDataStoreConfiguration.h"
 #import "_WKWebsiteDataStoreDelegate.h"
-#import <WebCore/Credential.h>
 #import <WebKit/ServiceWorkerProcessProxy.h>
 #import <wtf/BlockPtr.h>
 #import <wtf/URL.h>
@@ -51,7 +48,6 @@ public:
     explicit WebsiteDataStoreClient(id <_WKWebsiteDataStoreDelegate> delegate)
         : m_delegate(delegate)
         , m_hasRequestStorageSpaceSelector([m_delegate.get() respondsToSelector:@selector(requestStorageSpace: frameOrigin: quota: currentSize: spaceRequired: decisionHandler:)])
-        , m_hasAuthenticationChallengeSelector([m_delegate.get() respondsToSelector:@selector(didReceiveAuthenticationChallenge: completionHandler:)])
     {
     }
 
@@ -77,28 +73,8 @@ private:
         [m_delegate.getAutoreleased() requestStorageSpace:mainFrameURL frameOrigin:frameURL quota:quota currentSize:currentSize spaceRequired:spaceRequired decisionHandler:decisionHandler.get()];
     }
 
-    void didReceiveAuthenticationChallenge(Ref<WebKit::AuthenticationChallengeProxy>&& challenge) final
-    {
-        if (!m_hasAuthenticationChallengeSelector || !m_delegate) {
-            challenge->listener().completeChallenge(WebKit::AuthenticationChallengeDisposition::PerformDefaultHandling);
-            return;
-        }
-
-        auto nsURLChallenge = wrapper(challenge);
-        auto checker = WebKit::CompletionHandlerCallChecker::create(m_delegate.getAutoreleased(), @selector(didReceiveAuthenticationChallenge: completionHandler:));
-        auto completionHandler = makeBlockPtr([challenge = WTFMove(challenge), checker = WTFMove(checker)](NSURLSessionAuthChallengeDisposition disposition, NSURLCredential *credential) mutable {
-            if (checker->completionHandlerHasBeenCalled())
-                return;
-            checker->didCallCompletionHandler();
-            challenge->listener().completeChallenge(WebKit::toAuthenticationChallengeDisposition(disposition), WebCore::Credential(credential));
-        });
-
-        [m_delegate.getAutoreleased() didReceiveAuthenticationChallenge:nsURLChallenge completionHandler:completionHandler.get()];
-    }
-
     WeakObjCPtr<id <_WKWebsiteDataStoreDelegate> > m_delegate;
     bool m_hasRequestStorageSpaceSelector { false };
-    bool m_hasAuthenticationChallengeSelector { false };
 };
 
 @implementation WKWebsiteDataStore
index dc41288..9b0e717 100644 (file)
@@ -34,6 +34,4 @@ WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA))
 
 - (void)requestStorageSpace:(NSURL *)mainFrameURL frameOrigin:(NSURL *)frameURL quota:(NSUInteger)quota currentSize:(NSUInteger)currentSize spaceRequired:(NSUInteger)spaceRequired decisionHandler:(void (^)(unsigned long long quota))decisionHandler;
 
-- (void)didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition disposition, NSURLCredential *credential))completionHandler;
-
 @end
index 365603e..59f87a2 100644 (file)
@@ -35,7 +35,6 @@
 #import "APIURL.h"
 #import "APIWebsiteDataStore.h"
 #import "AuthenticationChallengeDisposition.h"
-#import "AuthenticationChallengeDispositionCocoa.h"
 #import "AuthenticationDecisionListener.h"
 #import "CompletionHandlerCallChecker.h"
 #import "Logging.h"
@@ -960,6 +959,21 @@ bool NavigationState::NavigationClient::shouldBypassContentModeSafeguards() cons
         || m_navigationState.m_navigationDelegateMethods.webViewDecidePolicyForNavigationActionWithPreferencesUserInfoDecisionHandler;
 }
 
+static AuthenticationChallengeDisposition toAuthenticationChallengeDisposition(NSURLSessionAuthChallengeDisposition disposition)
+{
+    switch (disposition) {
+    case NSURLSessionAuthChallengeUseCredential:
+        return AuthenticationChallengeDisposition::UseCredential;
+    case NSURLSessionAuthChallengePerformDefaultHandling:
+        return AuthenticationChallengeDisposition::PerformDefaultHandling;
+    case NSURLSessionAuthChallengeCancelAuthenticationChallenge:
+        return AuthenticationChallengeDisposition::Cancel;
+    case NSURLSessionAuthChallengeRejectProtectionSpace:
+        return AuthenticationChallengeDisposition::RejectProtectionSpaceAndContinue;
+    }
+    [NSException raise:NSInvalidArgumentException format:@"Invalid NSURLSessionAuthChallengeDisposition (%ld)", (long)disposition];
+}
+    
 void NavigationState::NavigationClient::didReceiveAuthenticationChallenge(WebPageProxy&, AuthenticationChallengeProxy& authenticationChallenge)
 {
     if (!m_navigationState.m_navigationDelegateMethods.webViewDidReceiveAuthenticationChallengeCompletionHandler)
@@ -974,7 +988,7 @@ void NavigationState::NavigationClient::didReceiveAuthenticationChallenge(WebPag
         if (checker->completionHandlerHasBeenCalled())
             return;
         checker->didCallCompletionHandler();
-        challenge->listener().completeChallenge(WebKit::toAuthenticationChallengeDisposition(disposition), Credential(credential));
+        challenge->listener().completeChallenge(toAuthenticationChallengeDisposition(disposition), Credential(credential));
     }).get()];
 }
 
index 2c0cad1..05d23fe 100644 (file)
@@ -37,9 +37,6 @@
 #include "NetworkProcessCreationParameters.h"
 #include "NetworkProcessMessages.h"
 #include "SandboxExtension.h"
-#if HAVE(SEC_KEY_PROXY)
-#include "SecKeyProxyStore.h"
-#endif
 #include "ShouldGrandfatherStatistics.h"
 #include "StorageAccessStatus.h"
 #include "WebCompiledContentRuleList.h"
@@ -315,36 +312,20 @@ void NetworkProcessProxy::didCreateNetworkConnectionToWebProcess(const IPC::Atta
 #endif
 }
 
-void NetworkProcessProxy::didReceiveAuthenticationChallenge(PAL::SessionID sessionID, PageIdentifier pageID, FrameIdentifier frameID, WebCore::AuthenticationChallenge&& coreChallenge, uint64_t challengeID)
+void NetworkProcessProxy::didReceiveAuthenticationChallenge(PageIdentifier pageID, FrameIdentifier frameID, WebCore::AuthenticationChallenge&& coreChallenge, uint64_t challengeID)
 {
-#if HAVE(SEC_KEY_PROXY)
-    WeakPtr<SecKeyProxyStore> secKeyProxyStore;
-    if (coreChallenge.protectionSpace().authenticationScheme() == ProtectionSpaceAuthenticationSchemeClientCertificateRequested) {
-        if (auto* store = websiteDataStoreFromSessionID(sessionID)) {
-            auto newSecKeyProxyStore = SecKeyProxyStore::create();
-            secKeyProxyStore = makeWeakPtr(newSecKeyProxyStore.get());
-            store->addSecKeyProxyStore(WTFMove(newSecKeyProxyStore));
-        }
+#if ENABLE(SERVICE_WORKER)
+    if (auto* serviceWorkerProcessProxy = m_processPool.serviceWorkerProcessProxyFromPageID(pageID)) {
+        auto authenticationChallenge = AuthenticationChallengeProxy::create(WTFMove(coreChallenge), challengeID, makeRef(*connection()), nullptr);
+        serviceWorkerProcessProxy->didReceiveAuthenticationChallenge(pageID, frameID, WTFMove(authenticationChallenge));
+        return;
     }
-    auto authenticationChallenge = AuthenticationChallengeProxy::create(WTFMove(coreChallenge), challengeID, makeRef(*connection()), WTFMove(secKeyProxyStore));
-#else
-    auto authenticationChallenge = AuthenticationChallengeProxy::create(WTFMove(coreChallenge), challengeID, makeRef(*connection()), nullptr);
 #endif
 
-    WebPageProxy* page = nullptr;
-    if (pageID && !m_processPool.isServiceWorkerPageID(pageID))
-        page = WebProcessProxy::webPage(pageID);
-
-    if (!page) {
-        auto* store = websiteDataStoreFromSessionID(sessionID);
-        if (!store || coreChallenge.protectionSpace().authenticationScheme() != ProtectionSpaceAuthenticationSchemeServerTrustEvaluationRequested) {
-            authenticationChallenge->listener().completeChallenge(AuthenticationChallengeDisposition::PerformDefaultHandling);
-            return;
-        }
-        store->client().didReceiveAuthenticationChallenge(WTFMove(authenticationChallenge));
-        return;
-    }
+    WebPageProxy* page = WebProcessProxy::webPage(pageID);
+    MESSAGE_CHECK(page);
 
+    auto authenticationChallenge = AuthenticationChallengeProxy::create(WTFMove(coreChallenge), challengeID, makeRef(*connection()), page->secKeyProxyStore(coreChallenge));
     page->didReceiveAuthenticationChallengeProxy(frameID, WTFMove(authenticationChallenge));
 }
 
index 42d5d83..9194ae6 100644 (file)
@@ -213,7 +213,7 @@ private:
     // Message handlers
     void didReceiveNetworkProcessProxyMessage(IPC::Connection&, IPC::Decoder&);
     void didCreateNetworkConnectionToWebProcess(const IPC::Attachment&);
-    void didReceiveAuthenticationChallenge(PAL::SessionID, WebCore::PageIdentifier, WebCore::FrameIdentifier, WebCore::AuthenticationChallenge&&, uint64_t challengeID);
+    void didReceiveAuthenticationChallenge(WebCore::PageIdentifier, WebCore::FrameIdentifier, WebCore::AuthenticationChallenge&&, uint64_t challengeID);
     void didFetchWebsiteData(uint64_t callbackID, const WebsiteData&);
     void didDeleteWebsiteData(uint64_t callbackID);
     void didDeleteWebsiteDataForOrigins(uint64_t callbackID);
index 5397acb..bfaf9f0 100644 (file)
@@ -23,7 +23,7 @@
 messages -> NetworkProcessProxy LegacyReceiver {
     DidCreateNetworkConnectionToWebProcess(IPC::Attachment connectionIdentifier)
 
-    DidReceiveAuthenticationChallenge(PAL::SessionID sessionID, WebCore::PageIdentifier pageID, WebCore::FrameIdentifier frameID, WebCore::AuthenticationChallenge challenge, uint64_t challengeID)
+    DidReceiveAuthenticationChallenge(WebCore::PageIdentifier pageID, WebCore::FrameIdentifier frameID, WebCore::AuthenticationChallenge challenge, uint64_t challengeID)
 
     DidFetchWebsiteData(uint64_t callbackID, struct WebKit::WebsiteData websiteData)
     DidDeleteWebsiteData(uint64_t callbackID)
index 99021cf..f78a7c3 100644 (file)
@@ -90,6 +90,22 @@ void ServiceWorkerProcessProxy::updatePreferencesStore(const WebPreferencesStore
     send(Messages::WebSWContextManagerConnection::UpdatePreferencesStore { store }, 0);
 }
 
+void ServiceWorkerProcessProxy::didReceiveAuthenticationChallenge(PageIdentifier pageID, FrameIdentifier frameID, Ref<AuthenticationChallengeProxy>&& challenge)
+{
+    UNUSED_PARAM(pageID);
+    UNUSED_PARAM(frameID);
+
+    // FIXME: Expose an API to delegate the actual decision to the application layer.
+    auto& protectionSpace = challenge->core().protectionSpace();
+    if (protectionSpace.authenticationScheme() == WebCore::ProtectionSpaceAuthenticationSchemeServerTrustEvaluationRequested && processPool().allowsAnySSLCertificateForServiceWorker()) {
+        auto credential = WebCore::Credential("accept server trust"_s, emptyString(), WebCore::CredentialPersistenceNone);
+        challenge->listener().completeChallenge(AuthenticationChallengeDisposition::UseCredential, credential);
+        return;
+    }
+    notImplemented();
+    challenge->listener().completeChallenge(AuthenticationChallengeDisposition::PerformDefaultHandling);
+}
+
 } // namespace WebKit
 
 #endif // ENABLE(SERVICE_WORKER)
index f693ab8..7d88760 100644 (file)
@@ -41,6 +41,8 @@ public:
 
     static bool hasRegisteredServiceWorkers(const String& serviceWorkerDirectory);
 
+    void didReceiveAuthenticationChallenge(WebCore::PageIdentifier, WebCore::FrameIdentifier, Ref<AuthenticationChallengeProxy>&&);
+
     void start(const WebPreferencesStore&, Optional<PAL::SessionID> initialSessionID);
     void setUserAgent(const String&);
     void updatePreferencesStore(const WebPreferencesStore&);
index 6baa662..ee7e588 100644 (file)
@@ -7333,6 +7333,19 @@ void WebPageProxy::gamepadActivity(const Vector<GamepadData>& gamepadDatas, bool
 
 #endif
 
+WeakPtr<SecKeyProxyStore> WebPageProxy::secKeyProxyStore(const WebCore::AuthenticationChallenge& challenge)
+{
+#if HAVE(SEC_KEY_PROXY)
+    if (challenge.protectionSpace().authenticationScheme() == ProtectionSpaceAuthenticationSchemeClientCertificateRequested) {
+        auto secKeyProxyStore = SecKeyProxyStore::create();
+        auto weakPointer = makeWeakPtr(secKeyProxyStore.get());
+        m_websiteDataStore->addSecKeyProxyStore(WTFMove(secKeyProxyStore));
+        return weakPointer;
+    }
+#endif
+    return nullptr;
+}
+    
 void WebPageProxy::didReceiveAuthenticationChallengeProxy(FrameIdentifier, Ref<AuthenticationChallengeProxy>&& authenticationChallenge)
 {
     m_navigationClient->didReceiveAuthenticationChallenge(*this, authenticationChallenge.get());
index 459a9d3..4724aae 100644 (file)
@@ -2231,17 +2231,17 @@ void WebProcessPool::reinstateNetworkProcessAssertionState(NetworkProcessProxy&
 #endif
 }
 
-bool WebProcessPool::isServiceWorkerPageID(PageIdentifier pageID) const
-{
 #if ENABLE(SERVICE_WORKER)
+ServiceWorkerProcessProxy* WebProcessPool::serviceWorkerProcessProxyFromPageID(PageIdentifier pageID) const
+{
     // FIXME: This is inefficient.
     for (auto* serviceWorkerProcess : m_serviceWorkerProcesses.values()) {
         if (serviceWorkerProcess->pageID() == pageID)
-            return true;
+            return serviceWorkerProcess;
     }
-#endif
-    return false;
+    return nullptr;
 }
+#endif
 
 void WebProcessPool::addProcessToOriginCacheSet(WebProcessProxy& process, const URL& url)
 {
index af16cef..40bea86 100644 (file)
@@ -379,9 +379,9 @@ public:
 
     void getNetworkProcessConnection(WebProcessProxy&, Messages::WebProcessProxy::GetNetworkProcessConnection::DelayedReply&&);
 
-    bool isServiceWorkerPageID(WebCore::PageIdentifier) const;
 #if ENABLE(SERVICE_WORKER)
     void establishWorkerContextConnectionToNetworkProcess(NetworkProcessProxy&, WebCore::RegistrableDomain&&, Optional<PAL::SessionID>);
+    ServiceWorkerProcessProxy* serviceWorkerProcessProxyFromPageID(WebCore::PageIdentifier) const;
     const HashMap<WebCore::RegistrableDomain, ServiceWorkerProcessProxy*>& serviceWorkerProxies() const { return m_serviceWorkerProcesses; }
     void setAllowsAnySSLCertificateForServiceWorker(bool allows) { m_allowsAnySSLCertificateForServiceWorker = allows; }
     bool allowsAnySSLCertificateForServiceWorker() const { return m_allowsAnySSLCertificateForServiceWorker; }
index 1b57d6b..d0bba56 100644 (file)
@@ -25,9 +25,6 @@
 
 #pragma once
 
-#include "AuthenticationChallengeDisposition.h"
-#include "AuthenticationChallengeProxy.h"
-#include "AuthenticationDecisionListener.h"
 #include <wtf/CompletionHandler.h>
 
 namespace WebCore {
@@ -45,11 +42,6 @@ public:
     {
         completionHandler({ });
     }
-
-    virtual void didReceiveAuthenticationChallenge(Ref<AuthenticationChallengeProxy>&& challenge)
-    {
-        challenge->listener().completeChallenge(AuthenticationChallengeDisposition::PerformDefaultHandling);
-    }
 };
 
 } // namespace WebKit
index 14a8082..eeb0066 100644 (file)
                41897ED51F415D850016FA42 /* CacheStorageEngineConnection.messages.in */ = {isa = PBXFileReference; lastKnownFileType = text; path = CacheStorageEngineConnection.messages.in; sourceTree = "<group>"; };
                41897ED61F415D860016FA42 /* CacheStorageEngine.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CacheStorageEngine.cpp; sourceTree = "<group>"; };
                419ACF9B1F981D26009F1A83 /* WebServiceWorkerFetchTaskClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebServiceWorkerFetchTaskClient.h; sourceTree = "<group>"; };
-               41A5F7B9226ECF7C00671764 /* AuthenticationChallengeDispositionCocoa.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AuthenticationChallengeDispositionCocoa.h; sourceTree = "<group>"; };
-               41A5F7BA226ECF7C00671764 /* AuthenticationChallengeDispositionCocoa.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = AuthenticationChallengeDispositionCocoa.mm; sourceTree = "<group>"; };
                41AC86811E042E5300303074 /* WebRTCResolver.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; lineEnding = 0; name = WebRTCResolver.messages.in; path = Network/webrtc/WebRTCResolver.messages.in; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = "<none>"; };
                41B28B081F83AD3E00FB52AC /* RTCPacketOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RTCPacketOptions.h; sourceTree = "<group>"; };
                41B28B091F83AD3E00FB52AC /* RTCPacketOptions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RTCPacketOptions.cpp; sourceTree = "<group>"; };
                57B4B45C20B5048B00D4AD79 /* cocoa */ = {
                        isa = PBXGroup;
                        children = (
-                               41A5F7B9226ECF7C00671764 /* AuthenticationChallengeDispositionCocoa.h */,
-                               41A5F7BA226ECF7C00671764 /* AuthenticationChallengeDispositionCocoa.mm */,
                                57B4B45D20B504AB00D4AD79 /* AuthenticationManagerCocoa.mm */,
                                44A481C621F2D27B00F2F919 /* ClientCertificateAuthenticationXPCConstants.cpp */,
                                57B4B45E20B504AB00D4AD79 /* ClientCertificateAuthenticationXPCConstants.h */,
index 58c0a38..998f447 100644 (file)
@@ -1,3 +1,17 @@
+2019-08-23  Ryan Haddad  <ryanhaddad@apple.com>
+
+        Unreviewed, rolling out r249001.
+
+        Caused one layout test to fail on all configurations and
+        another to time out on Catalina / iOS 13.
+
+        Reverted changeset:
+
+        "Add a WebsiteDataStore delegate to handle
+        AuthenticationChallenge that do not come from pages"
+        https://bugs.webkit.org/show_bug.cgi?id=196870
+        https://trac.webkit.org/changeset/249001
+
 2019-08-23  Jonathan Bedard  <jbedard@apple.com>
 
         results.webkit.org: Escape html in changelog
index 7262f95..5ffb743 100644 (file)
@@ -1032,9 +1032,7 @@ bool TestController::resetStateToConsistentValues(const TestOptions& options, Re
 #if PLATFORM(IOS_FAMILY)
     m_openPanelFileURLsMediaIcon = nullptr;
 #endif
-
-    setAllowsAnySSLCertificate(true);
-
+    
     statisticsResetToConsistentState();
     
     clearAdClickAttribution();
@@ -1183,13 +1181,10 @@ const char* TestController::networkProcessName()
 #endif
 }
 
-#if !PLATFORM(COCOA)
 void TestController::setAllowsAnySSLCertificate(bool allows)
 {
-    m_allowsAnySSLCertificate = allows;
     WKContextSetAllowsAnySSLCertificateForWebSocketTesting(platformContext(), allows);
 }
-#endif
 
 static std::string testPath(WKURLRef url)
 {
@@ -2333,12 +2328,8 @@ void TestController::didReceiveAuthenticationChallenge(WKPageRef page, WKAuthent
 
         m_serverTrustEvaluationCallbackCallsCount++;
 
-        if (m_allowsAnySSLCertificate) {
-            WKRetainPtr<WKCredentialRef> credential = adoptWK(WKCredentialCreate(toWK("accept server trust").get(), toWK("").get(), kWKCredentialPersistenceNone));
-            WKAuthenticationDecisionListenerUseCredential(decisionListener, credential.get());
-            return;
-        }
-        WKAuthenticationDecisionListenerRejectProtectionSpaceAndContinue(decisionListener);
+        WKRetainPtr<WKCredentialRef> credential = adoptWK(WKCredentialCreate(toWK("accept server trust").get(), toWK("").get(), kWKCredentialPersistenceNone));
+        WKAuthenticationDecisionListenerUseCredential(decisionListener, credential.get());
         return;
     }
 
index e569c72..3400f4c 100644 (file)
@@ -591,7 +591,6 @@ private:
 
     uint64_t m_serverTrustEvaluationCallbackCallsCount { 0 };
     bool m_shouldDismissJavaScriptAlertsAsynchronously { false };
-    bool m_allowsAnySSLCertificate { true };
 };
 
 struct TestCommand {
index 0459685..0ebf7bf 100644 (file)
@@ -35,7 +35,6 @@
 #import <Foundation/Foundation.h>
 #import <Security/SecItem.h>
 #import <WebKit/WKContextConfigurationRef.h>
-#import <WebKit/WKContextPrivate.h>
 #import <WebKit/WKCookieManager.h>
 #import <WebKit/WKPreferencesRefPrivate.h>
 #import <WebKit/WKProcessPoolPrivate.h>
@@ -398,13 +397,6 @@ void TestController::setAllowStorageQuotaIncrease(bool value)
     [globalWebsiteDataStoreDelegateClient setAllowRaisingQuota: value];
 }
 
-void TestController::setAllowsAnySSLCertificate(bool allows)
-{
-    m_allowsAnySSLCertificate = allows;
-    WKContextSetAllowsAnySSLCertificateForWebSocketTesting(platformContext(), allows);
-    [globalWebsiteDataStoreDelegateClient setAllowAnySSLCertificate: allows];
-}
-
 bool TestController::canDoServerTrustEvaluationInNetworkProcess() const
 {
 #if HAVE(CFNETWORK_NSURLSESSION_STRICTRUSTEVALUATE)
index d638e82..91b94ff 100644 (file)
@@ -30,9 +30,7 @@
 @interface TestWebsiteDataStoreDelegate: NSObject <_WKWebsiteDataStoreDelegate> {
 @private
     BOOL _shouldAllowRaisingQuota;
-    BOOL _shouldAllowAnySSLCertificate;
 }
 - (instancetype)init;
 - (void)setAllowRaisingQuota:(BOOL)shouldAllowRaisingQuota;
-- (void)setAllowAnySSLCertificate:(BOOL)shouldAllowAnySSLCertificate;
 @end
index e1f68e4..8ef467a 100644 (file)
 {
     _shouldAllowRaisingQuota = shouldAllowRaisingQuota;
 }
-
-- (void)didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition disposition, NSURLCredential * _Nullable credential))completionHandler
-{
-    NSString *method = challenge.protectionSpace.authenticationMethod;
-    if ([method isEqualToString:NSURLAuthenticationMethodServerTrust]) {
-        if (_shouldAllowAnySSLCertificate)
-            completionHandler(NSURLSessionAuthChallengeUseCredential, [NSURLCredential credentialForTrust: challenge.protectionSpace.serverTrust]);
-        else
-            completionHandler(NSURLSessionAuthChallengeCancelAuthenticationChallenge, nil);
-        return;
-    }
-    completionHandler(NSURLSessionAuthChallengePerformDefaultHandling, nil);
-}
-
-- (void)setAllowAnySSLCertificate:(BOOL)shouldAllowAnySSLCertificate
-{
-    _shouldAllowAnySSLCertificate = shouldAllowAnySSLCertificate;
-}
-
 @end