⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 265573 in webkit


Ignore:
Timestamp:
Aug 12, 2020, 4:06:19 PM (6 years ago)
Author:
commit-queue@webkit.org
Message:

Fail preconnect requests to deprecated TLS instead of allowing application to show warning
https://bugs.webkit.org/show_bug.cgi?id=215424
<rdar://problem/66784116>

Patch by Alex Christensen <achristensen@webkit.org> on 2020-08-12
Reviewed by Geoffrey Garen.

Source/WebKit:

Preconnecting is just a suggestion, so if the content really wants to load something from the deprecated TLS server,
we will see the warning when the load actually happens.

  • NetworkProcess/cocoa/NetworkSessionCocoa.mm:

(-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):

Tools:

  • TestWebKitAPI/Tests/WebKitCocoa/TLSDeprecation.mm:

(TestWebKitAPI::TEST):
(TestWebKitAPI::webViewWithNavigationDelegate):

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r265572 r265573  
     12020-08-12  Alex Christensen  <achristensen@webkit.org>
     2
     3        Fail preconnect requests to deprecated TLS instead of allowing application to show warning
     4        https://bugs.webkit.org/show_bug.cgi?id=215424
     5        <rdar://problem/66784116>
     6
     7        Reviewed by Geoffrey Garen.
     8
     9        Preconnecting is just a suggestion, so if the content really wants to load something from the deprecated TLS server,
     10        we will see the warning when the load actually happens.
     11
     12        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
     13        (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
     14
    1152020-08-12  Brent Fulgham  <bfulgham@apple.com>
    216
  • trunk/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm

    r265230 r265573  
    675675        ALLOW_DEPRECATED_DECLARATIONS_END
    676676
     677        if (negotiatedLegacyTLS == NegotiatedLegacyTLS::Yes && task._preconnect)
     678            return completionHandler(NSURLSessionAuthChallengeCancelAuthenticationChallenge, nil);
     679
    677680        // Handle server trust evaluation at platform-level if requested, for performance reasons and to use ATS defaults.
    678681        if (sessionCocoa->fastServerTrustEvaluationEnabled() && negotiatedLegacyTLS == NegotiatedLegacyTLS::No) {
  • trunk/Tools/ChangeLog

    r265565 r265573  
     12020-08-12  Alex Christensen  <achristensen@webkit.org>
     2
     3        Fail preconnect requests to deprecated TLS instead of allowing application to show warning
     4        https://bugs.webkit.org/show_bug.cgi?id=215424
     5        <rdar://problem/66784116>
     6
     7        Reviewed by Geoffrey Garen.
     8
     9        * TestWebKitAPI/Tests/WebKitCocoa/TLSDeprecation.mm:
     10        (TestWebKitAPI::TEST):
     11        (TestWebKitAPI::webViewWithNavigationDelegate):
     12
    1132020-08-12  Aakash Jain  <aakash_jain@apple.com>
    214
  • trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/TLSDeprecation.mm

    r260914 r265573  
    243243}
    244244
     245TEST(TLSVersion, Preconnect)
     246{
     247    bool connectionAttempted = false;
     248    TCPServer server(TCPServer::Protocol::HTTPS, [&](SSL *ssl) {
     249        EXPECT_FALSE(ssl);
     250        connectionAttempted = true;
     251    }, tls1_1);
     252
     253    auto webView = adoptNS([WKWebView new]);
     254    [webView loadHTMLString:makeString("<head><link rel='preconnect' href='https://127.0.0.1:", server.port(), "/'></link></head>") baseURL:nil];
     255
     256    auto delegate = adoptNS([TestNavigationDelegate new]);
     257    [webView setNavigationDelegate:delegate.get()];
     258    [delegate setDidReceiveAuthenticationChallenge:^(WKWebView *, NSURLAuthenticationChallenge *challenge, void (^callback)(NSURLSessionAuthChallengeDisposition, NSURLCredential *)) {
     259        EXPECT_TRUE(false);
     260        callback(NSURLSessionAuthChallengeUseCredential, nil);
     261    }];
     262
     263    TestWebKitAPI::Util::run(&connectionAttempted);
     264}
     265
    245266#endif // HAVE(TLS_VERSION_DURING_CHALLENGE)
    246267
Note: See TracChangeset for help on using the changeset viewer.