[WK2][SOUP] initialise the Network Process with ignoreTLSErrors
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 10 Dec 2013 12:21:03 +0000 (12:21 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 10 Dec 2013 12:21:03 +0000 (12:21 +0000)
https://bugs.webkit.org/show_bug.cgi?id=125490

ResourceHandleSoup in the Network Process and is not initialised with
a policy on ignoring TLS errors.  This simply requires that the
appropriate message is created for the Network Process and the
parameter created for initialisation.

Patch by Brian Holt <brian.holt@samsung.com> on 2013-12-10
Reviewed by Gustavo Noronha Silva.

* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* NetworkProcess/soup/NetworkProcessSoup.cpp:
(WebKit::NetworkProcess::platformInitializeNetworkProcess):
(WebKit::NetworkProcess::setIgnoreTLSErrors):
* Shared/Network/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode):
(WebKit::NetworkProcessCreationParameters::decode):
* Shared/Network/NetworkProcessCreationParameters.h:
* UIProcess/gtk/WebContextGtk.cpp:
(WebKit::WebContext::platformInitializeWebProcess):
* UIProcess/soup/WebContextSoup.cpp:
(WebKit::WebContext::platformInitializeNetworkProcess):

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

Source/WebKit2/ChangeLog
Source/WebKit2/NetworkProcess/NetworkProcess.h
Source/WebKit2/NetworkProcess/NetworkProcess.messages.in
Source/WebKit2/NetworkProcess/soup/NetworkProcessSoup.cpp
Source/WebKit2/Shared/Network/NetworkProcessCreationParameters.cpp
Source/WebKit2/Shared/Network/NetworkProcessCreationParameters.h
Source/WebKit2/UIProcess/gtk/WebContextGtk.cpp
Source/WebKit2/UIProcess/soup/WebContextSoup.cpp

index 2481eb47cf1b9a9c7e2769a7b45e4b2c69a0fac8..b938aaa4c8e7d5ee5cccf94d5f4619413636bba3 100644 (file)
@@ -1,3 +1,29 @@
+2013-12-10  Brian Holt  <brian.holt@samsung.com>
+
+        [WK2][SOUP] initialise the Network Process with ignoreTLSErrors
+        https://bugs.webkit.org/show_bug.cgi?id=125490
+
+        ResourceHandleSoup in the Network Process and is not initialised with
+        a policy on ignoring TLS errors.  This simply requires that the
+        appropriate message is created for the Network Process and the
+        parameter created for initialisation.
+
+        Reviewed by Gustavo Noronha Silva.
+
+        * NetworkProcess/NetworkProcess.h:
+        * NetworkProcess/NetworkProcess.messages.in:
+        * NetworkProcess/soup/NetworkProcessSoup.cpp:
+        (WebKit::NetworkProcess::platformInitializeNetworkProcess):
+        (WebKit::NetworkProcess::setIgnoreTLSErrors):
+        * Shared/Network/NetworkProcessCreationParameters.cpp:
+        (WebKit::NetworkProcessCreationParameters::encode):
+        (WebKit::NetworkProcessCreationParameters::decode):
+        * Shared/Network/NetworkProcessCreationParameters.h:
+        * UIProcess/gtk/WebContextGtk.cpp:
+        (WebKit::WebContext::platformInitializeWebProcess):
+        * UIProcess/soup/WebContextSoup.cpp:
+        (WebKit::WebContext::platformInitializeNetworkProcess):
+
 2013-12-09  Anders Carlsson  <andersca@apple.com>
 
         Begin working on a UserData class intended to replace UserMessageCoders
index 85b56f88281fc09802f4f6cdda2bd55961f4670b..3e39e7c92da95a2d5b76629fdf046abc7c358d4f 100644 (file)
@@ -108,6 +108,10 @@ private:
     void getNetworkProcessStatistics(uint64_t callbackID);
     void clearCacheForAllOrigins(uint32_t cachesToClear);
 
+#if USE(SOUP)
+    void setIgnoreTLSErrors(bool);
+#endif
+
     // Platform Helpers
     void platformSetCacheModel(CacheModel);
 
index 12c7275ebd5cc29b8c2ec410378d93f076923df5..99348b8f7680de2b341562769b4010e1576efe0e 100644 (file)
@@ -29,6 +29,10 @@ messages -> NetworkProcess LegacyReceiver {
     # Creates a connection for communication with a WebProcess
     CreateNetworkConnectionToWebProcess()
 
+#if USE(SOUP)
+    SetIgnoreTLSErrors(bool ignoreTLSErrors)
+#endif
+
     EnsurePrivateBrowsingSession()
     DestroyPrivateBrowsingSession()
 
index a04f68aee220f91b70c0fb152eb4fc4c7be01968..2e7843f10ce57aa8cff1ccd8c3832ef794432468 100644 (file)
@@ -78,6 +78,8 @@ void NetworkProcess::platformInitializeNetworkProcess(const NetworkProcessCreati
     GRefPtr<SoupCache> soupCache = adoptGRef(soup_cache_new(parameters.diskCacheDirectory.utf8().data(), SOUP_CACHE_SINGLE_USER));
     soup_session_add_feature(WebCore::ResourceHandle::defaultSession(), SOUP_SESSION_FEATURE(soupCache.get()));
     soup_cache_load(soupCache.get());
+
+    setIgnoreTLSErrors(parameters.ignoreTLSErrors);
 }
 
 void NetworkProcess::platformSetCacheModel(CacheModel cacheModel)
@@ -104,6 +106,11 @@ void NetworkProcess::platformSetCacheModel(CacheModel cacheModel)
         soup_cache_set_max_size(cache, urlCacheDiskCapacity);
 }
 
+void NetworkProcess::setIgnoreTLSErrors(bool ignoreTLSErrors)
+{
+    ResourceHandle::setIgnoreSSLErrors(ignoreTLSErrors);
+}
+
 void NetworkProcess::allowSpecificHTTPSCertificateForHost(const CertificateInfo&, const String&)
 {
     notImplemented();
index 03ead278f5e79b9453f4b37fcb8e3f4f62bf3c01..372aee6b6c5a85cdbe309ba764542aae7cd335cb 100644 (file)
@@ -54,6 +54,9 @@ void NetworkProcessCreationParameters::encode(CoreIPC::ArgumentEncoder& encoder)
     encoder << httpProxy;
     encoder << httpsProxy;
 #endif
+#if USE(SOUP)
+    encoder << ignoreTLSErrors;
+#endif
 }
 
 bool NetworkProcessCreationParameters::decode(CoreIPC::ArgumentDecoder& decoder, NetworkProcessCreationParameters& result)
@@ -87,6 +90,11 @@ bool NetworkProcessCreationParameters::decode(CoreIPC::ArgumentDecoder& decoder,
         return false;
 #endif
 
+#if USE(SOUP)
+    if (!decoder.decode(result.ignoreTLSErrors))
+        return false;
+#endif
+
     return true;
 }
 
index a24593f5a952a127152a1c24fe7b3ba8e30e3577..d879bcac9cee6e816c8ed67da3bb2c6c02283713 100644 (file)
@@ -67,6 +67,10 @@ struct NetworkProcessCreationParameters {
     String httpProxy;
     String httpsProxy;
 #endif
+
+#if USE(SOUP)
+    bool ignoreTLSErrors;
+#endif
 };
 
 } // namespace WebKit
index f43b019d0de1bdc920290b3640220cf4ad66822e..602468db55e726ff39225bceebc47e141a4cf6ad 100644 (file)
@@ -97,10 +97,11 @@ void WebContext::platformInitializeWebProcess(WebProcessCreationParameters& para
     parameters.urlSchemesRegistered = supplement<WebSoupRequestManagerProxy>()->registeredURISchemes();
     supplement<WebCookieManagerProxy>()->getCookiePersistentStorage(parameters.cookiePersistentStoragePath, parameters.cookiePersistentStorageType);
     parameters.cookieAcceptPolicy = m_initialHTTPCookieAcceptPolicy;
-    parameters.ignoreTLSErrors = m_ignoreTLSErrors;
     parameters.shouldTrackVisitedLinks = true;
 #if ENABLE(NETWORK_PROCESS)
     parameters.usesNetworkProcess = true;
+#else
+    parameters.ignoreTLSErrors = m_ignoreTLSErrors;
 #endif
 }
 
index 9cb9cdf3da6d6f02c45f40eb5e781ddc92b5ddbf..9dfde5ecd200fc7c23ac368e7a7567834de59783 100644 (file)
@@ -31,8 +31,9 @@
 
 namespace WebKit {
 
-void WebContext::platformInitializeNetworkProcess(NetworkProcessCreationParameters&)
+void WebContext::platformInitializeNetworkProcess(NetworkProcessCreationParameters& parameters)
 {
+    parameters.ignoreTLSErrors = m_ignoreTLSErrors;
 }
 
 }