[Xfce4-commits] <midori:master> Conditionalize SSL validation on libsoup 2.29.91

Christian Dywan noreply at xfce.org
Wed Apr 14 22:42:01 CEST 2010


Updating branch refs/heads/master
         to aade642897753645be7359a579cd99477b7dc34d (commit)
       from 505c7e4bc1e3df7c0c52f2a5f8e4023f1fd057b8 (commit)

commit aade642897753645be7359a579cd99477b7dc34d
Author: Christian Dywan <christian at twotoasts.de>
Date:   Wed Apr 14 22:38:21 2010 +0200

    Conditionalize SSL validation on libsoup 2.29.91
    
    The flag in the SoupMessage to verify secure connections is
    only available in recent versions of libsoup. So we continue
    to be oblivious to certificates with older versions.

 midori/main.c        |    7 +++++--
 midori/midori-view.c |    2 ++
 wscript              |    1 +
 3 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/midori/main.c b/midori/main.c
index d8b73f7..2d43bd4 100644
--- a/midori/main.c
+++ b/midori/main.c
@@ -849,6 +849,10 @@ midori_soup_session_prepare (SoupSession*       session,
                              SoupCookieJar*     cookie_jar,
                              MidoriWebSettings* settings)
 {
+    SoupSessionFeature* feature;
+    gchar* config_file;
+
+    #if WEBKIT_CHECK_VERSION (1, 1, 14) && defined (HAVE_LIBSOUP_2_29_91)
     const gchar* certificate_files[] =
     {
         "/etc/pki/tls/certs/ca-bundle.crt",
@@ -856,8 +860,6 @@ midori_soup_session_prepare (SoupSession*       session,
         NULL
     };
     guint i;
-    SoupSessionFeature* feature;
-    gchar* config_file;
 
     for (i = 0; i < G_N_ELEMENTS (certificate_files); i++)
         if (g_access (certificate_files[i], F_OK) == 0)
@@ -871,6 +873,7 @@ midori_soup_session_prepare (SoupSession*       session,
     if (i == G_N_ELEMENTS (certificate_files))
         g_warning (_("No root certificate file is available. "
                      "SSL certificates cannot be verified."));
+    #endif
 
     soup_session_settings_notify_http_proxy_cb (settings, NULL, session);
     g_signal_connect (settings, "notify::http-proxy",
diff --git a/midori/midori-view.c b/midori/midori-view.c
index 7a31e3f..310a5ca 100644
--- a/midori/midori-view.c
+++ b/midori/midori-view.c
@@ -1050,6 +1050,7 @@ webkit_web_view_load_committed_cb (WebKitWebView*  web_view,
 
     if (!strncmp (uri, "https", 5))
     {
+#if WEBKIT_CHECK_VERSION (1, 1, 14) && defined (HAVE_LIBSOUP_2_29_91)
         WebKitWebDataSource *source;
         WebKitNetworkRequest *request;
         SoupMessage *message;
@@ -1062,6 +1063,7 @@ webkit_web_view_load_committed_cb (WebKitWebView*  web_view,
          && soup_message_get_flags (message) & SOUP_MESSAGE_CERTIFICATE_TRUSTED)
             view->security = MIDORI_SECURITY_TRUSTED;
         else
+#endif
             view->security = MIDORI_SECURITY_UNKNOWN;
     }
     else
diff --git a/wscript b/wscript
index a64c9bf..8b85f29 100644
--- a/wscript
+++ b/wscript
@@ -217,6 +217,7 @@ def configure (conf):
     conf.define ('HAVE_LIBSOUP_2_25_2', 1)
     check_pkg ('libsoup-2.4', '2.27.90', False, var='LIBSOUP_2_27_90')
     check_pkg ('libsoup-2.4', '2.29.3', False, var='LIBSOUP_2_29_3')
+    check_pkg ('libsoup-2.4', '2.29.91', False, var='LIBSOUP_2_29_91')
     check_pkg ('libxml-2.0', '2.6')
 
     if conf.env['HAVE_LIBSOUP_2_27_90']:



More information about the Xfce4-commits mailing list