[gnome-online-accounts/gnome-3-8] mail-client: Check cert_flags instead of G_TLS_ERROR_BAD_CERTIFICATE



commit df2ecbba7432f83bbdf376d1aef77fffa4213b5e
Author: Debarshi Ray <debarshir gnome org>
Date:   Mon Mar 11 14:17:10 2013 +0100

    mail-client: Check cert_flags instead of G_TLS_ERROR_BAD_CERTIFICATE
    
    GIO sets G_TLS_ERROR_BAD_CERTIFICATE when it should be setting
    G_TLS_ERROR_HANDSHAKE. Hence, lets check the GTlsCertificate flags to
    accommodate future GIO fixes.

 src/goabackend/goamailclient.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/src/goabackend/goamailclient.c b/src/goabackend/goamailclient.c
index 4f34a5a..e34df95 100644
--- a/src/goabackend/goamailclient.c
+++ b/src/goabackend/goamailclient.c
@@ -187,7 +187,11 @@ mail_client_check_tls_conn_handshake_cb (GObject *source_object, GAsyncResult *r
                    error->message,
                    g_quark_to_string (error->domain),
                    error->code);
-      if (error->code == G_TLS_ERROR_BAD_CERTIFICATE)
+      /* GIO sets G_TLS_ERROR_BAD_CERTIFICATE when it should be
+       * setting G_TLS_ERROR_HANDSHAKE. Hence, lets check the
+       * GTlsCertificate flags to accommodate future GIO fixes.
+       */
+      if (data->cert_flags != 0)
         {
           GError *tls_error;
 
@@ -312,7 +316,11 @@ mail_client_check_connect_cb (GObject *source_object, GAsyncResult *res, gpointe
                    error->message,
                    g_quark_to_string (error->domain),
                    error->code);
-      if (error->code == G_TLS_ERROR_BAD_CERTIFICATE)
+      /* GIO sets G_TLS_ERROR_BAD_CERTIFICATE when it should be
+       * setting G_TLS_ERROR_HANDSHAKE. Hence, lets check the
+       * GTlsCertificate flags to accommodate future GIO fixes.
+       */
+      if (data->cert_flags != 0)
         {
           GError *tls_error;
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]