[glib-networking/wip/openssl-2-46: 6/28] Set the certificate even if there is a bad certificate error



commit 95d16b3d64fb669654ace62702a3013ab355438f
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 712abb7..d9bf7ce 100644
--- a/tls/gnutls/gtlsconnection-gnutls.c
+++ b/tls/gnutls/gtlsconnection-gnutls.c
@@ -622,6 +622,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;
@@ -635,7 +636,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),
@@ -643,7 +644,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]