[glib-networking/wip/tlssplit: 7/7] Set the certificate even if there is a bad certificate error



commit 713f8ef1ac8ff844ca5422b6e14fa00a2f5a9f0f
Author: Ignacio Casal Quinteiro <icq gnome org>
Date:   Fri Nov 6 11:27:50 2015 +0100

    Set the certificate even if there is a bad certificate error

 tls/gnutls/gtlsconnection-gnutls.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/tls/gnutls/gtlsconnection-gnutls.c b/tls/gnutls/gtlsconnection-gnutls.c
index a7a6b18..70899fa 100644
--- a/tls/gnutls/gtlsconnection-gnutls.c
+++ b/tls/gnutls/gtlsconnection-gnutls.c
@@ -619,6 +619,7 @@ g_tls_connection_gnutls_complete_handshake (GTlsConnectionBase  *tls,
   GTlsConnectionGnutls *gnutls = G_TLS_CONNECTION_GNUTLS (tls);
   GTlsCertificate *peer_certificate;
   GTlsCertificateFlags peer_certificate_errors = 0;
+  gboolean status = G_TLS_CONNECTION_BASE_OK;
 
   peer_certificate = gnutls->priv->peer_certificate_tmp;
   gnutls->priv->peer_certificate_tmp = NULL;
@@ -632,7 +633,7 @@ g_tls_connection_gnutls_complete_handshake (GTlsConnectionBase  *tls,
        {
          g_set_error_literal (error, G_TLS_ERROR, G_TLS_ERROR_BAD_CERTIFICATE,
                               _("Unacceptable TLS certificate"));
-         return G_TLS_CONNECTION_BASE_ERROR;
+         status = G_TLS_CONNECTION_BASE_ERROR;
        }
 
       g_tls_connection_base_set_peer_certificate (G_TLS_CONNECTION_BASE (gnutls),
@@ -640,7 +641,7 @@ g_tls_connection_gnutls_complete_handshake (GTlsConnectionBase  *tls,
                                                  peer_certificate_errors);
     }
 
-  return G_TLS_CONNECTION_BASE_OK;
+  return status;
 }
 
 static GTlsConnectionBaseStatus


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