From b7cc062d7daca8dbe4afb5a58d9888d229978207 Mon Sep 17 00:00:00 2001
From: Yann Leboulanger <asterix@lagaule.org>
Date: Sat, 15 Dec 2007 08:31:42 +0000
Subject: [PATCH] [shprotx] fix loading of multiple SSL certificates and better
 error message. fixes #3619

---
 src/common/xmpp/transports_nb.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/common/xmpp/transports_nb.py b/src/common/xmpp/transports_nb.py
index c4cda46366..6beb344b97 100644
--- a/src/common/xmpp/transports_nb.py
+++ b/src/common/xmpp/transports_nb.py
@@ -761,15 +761,18 @@ class NonBlockingTLS(PlugIn):
 			for line in lines:
 				if 'BEGIN CERTIFICATE' in line:
 					begin = i
-					continue
 				elif 'END CERTIFICATE' in line and begin > -1:
 					cert = ''.join(lines[begin:i+2])
 					try:
 						X509cert = OpenSSL.crypto.load_certificate(
 							OpenSSL.crypto.FILETYPE_PEM, cert)
 						store.add_cert(X509cert)
+					except OpenSSL.crypto.Error, exception_obj:
+						log.warning('Unable to load a certificate from file %s: %s' %\
+							(gajim.MY_CACERTS, exception_obj.message[0][2]))
 					except:
-						log.warning('Unable to load a certificate from file %s' % \
+						log.warning(
+							'Unknown error while loading certificate from file %s' % \
 							gajim.MY_CACERTS)
 					begin = -1
 				i += 1
-- 
GitLab