From 37e0797f304cfe478a54e7360b6c83d71db9aab8 Mon Sep 17 00:00:00 2001
From: Yann Leboulanger <asterix@lagaule.org>
Date: Tue, 25 Dec 2012 18:18:39 +0100
Subject: [PATCH] correctly get SSL certificate from nbxmpp. Fixes #7283

---
 src/common/connection.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/common/connection.py b/src/common/connection.py
index 4557596a60..3636c55cc2 100644
--- a/src/common/connection.py
+++ b/src/common/connection.py
@@ -1334,7 +1334,7 @@ class Connection(CommonConnection, ConnectionHandlers):
                 if con.Connection.ssl_fingerprint_sha1[-1] != saved_fingerprint:
                     gajim.nec.push_incoming_event(FingerprintErrorEvent(None,
                         conn=self,
-                        certificate=con.Connection.ssl_certificate,
+                        certificate=con.Connection.ssl_certificate[-1],
                         new_fingerprint=con.Connection.ssl_fingerprint_sha1[
                         -1]))
                     return True
@@ -1342,8 +1342,8 @@ class Connection(CommonConnection, ConnectionHandlers):
                 gajim.config.set_per('accounts', self.name,
                     'ssl_fingerprint_sha1',
                     con.Connection.ssl_fingerprint_sha1[-1])
-            if not check_X509.check_certificate(con.Connection.ssl_certificate,
-            hostname) and '100' not in gajim.config.get_per('accounts',
+            if not check_X509.check_certificate(con.Connection.ssl_certificate[
+            -1], hostname) and '100' not in gajim.config.get_per('accounts',
             self.name, 'ignore_ssl_errors').split():
                 txt = _('The authenticity of the %s certificate could be '
                     'invalid.\nThe certificate does not cover this domain.') % \
@@ -1352,7 +1352,7 @@ class Connection(CommonConnection, ConnectionHandlers):
                     error_text=txt, error_num=100,
                     cert=con.Connection.ssl_cert_pem[-1],
                     fingerprint=con.Connection.ssl_fingerprint_sha1[-1],
-                    certificate=con.Connection.ssl_certificate))
+                    certificate=con.Connection.ssl_certificate[-1]))
                 return True
 
         self._register_handlers(con, con_type)
-- 
GitLab