Title: [210180] trunk/Source/WebKit2
Revision
210180
Author
[email protected]
Date
2016-12-27 09:57:18 -0800 (Tue, 27 Dec 2016)

Log Message

Ensure NetworkProcess is ready before whitelisting TLS certificates
https://bugs.webkit.org/show_bug.cgi?id=162962

Patch by Emanuele Aina <[email protected]> on 2016-12-27
Reviewed by Alex Christensen.

If the API user tries to whitelist TLS certificates before any web
view has been created, the action will be ignored because the
NetworkProcess hasn't been fired up yet.

For example, the snippet below using the GTK+ API does not work,
unless the whitelisting is moved after the web view creation:

  webkit_web_context_allow_tls_certificate_for_host(webkit_web_context_get_default(), crt, host);
  webView = webkit_web_view_new();

* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::allowSpecificHTTPSCertificateForHost): Ensure
that the NetworkProcess has been already fired up when adding
certificates, so they can be whitelisted before the first web view is
instantiated.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (210179 => 210180)


--- trunk/Source/WebKit2/ChangeLog	2016-12-27 17:12:43 UTC (rev 210179)
+++ trunk/Source/WebKit2/ChangeLog	2016-12-27 17:57:18 UTC (rev 210180)
@@ -1,3 +1,26 @@
+2016-12-27  Emanuele Aina  <[email protected]>
+
+        Ensure NetworkProcess is ready before whitelisting TLS certificates
+        https://bugs.webkit.org/show_bug.cgi?id=162962
+
+        Reviewed by Alex Christensen.
+
+        If the API user tries to whitelist TLS certificates before any web
+        view has been created, the action will be ignored because the
+        NetworkProcess hasn't been fired up yet.
+
+        For example, the snippet below using the GTK+ API does not work,
+        unless the whitelisting is moved after the web view creation:
+
+          webkit_web_context_allow_tls_certificate_for_host(webkit_web_context_get_default(), crt, host);
+          webView = webkit_web_view_new();
+
+        * UIProcess/WebProcessPool.cpp:
+        (WebKit::WebProcessPool::allowSpecificHTTPSCertificateForHost): Ensure
+        that the NetworkProcess has been already fired up when adding
+        certificates, so they can be whitelisted before the first web view is
+        instantiated.
+
 2016-12-25  Yusuke Suzuki  <[email protected]>
 
         Propagate the source origin as much as possible

Modified: trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp (210179 => 210180)


--- trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp	2016-12-27 17:12:43 UTC (rev 210179)
+++ trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp	2016-12-27 17:57:18 UTC (rev 210180)
@@ -1136,8 +1136,8 @@
 
 void WebProcessPool::allowSpecificHTTPSCertificateForHost(const WebCertificateInfo* certificate, const String& host)
 {
-    if (m_networkProcess)
-        m_networkProcess->send(Messages::NetworkProcess::AllowSpecificHTTPSCertificateForHost(certificate->certificateInfo(), host), 0);
+    ensureNetworkProcess();
+    m_networkProcess->send(Messages::NetworkProcess::AllowSpecificHTTPSCertificateForHost(certificate->certificateInfo(), host), 0);
 }
 
 void WebProcessPool::updateAutomationCapabilities() const
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to