Skip to content

Commit 8fb725d

Browse files
committed
Accept more error messages in test_tls_ext_noca
OpenSSL 1.0, 1.1, and NSS return different error messages for untrusted certificate and missing CA. Closes: #87 Signed-off-by: Christian Heimes <cheimes@redhat.com>
1 parent 9f86c06 commit 8fb725d

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

Tests/t_cext.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -818,9 +818,15 @@ def test_tls_ext_noca(self):
818818
l.set_option(_ldap.OPT_PROTOCOL_VERSION, _ldap.VERSION3)
819819
with self.assertRaises(_ldap.CONNECT_ERROR) as e:
820820
l.start_tls_s()
821-
# some platforms return '(unknown error code)' as reason
822-
if '(unknown error code)' not in str(e.exception):
823-
self.assertIn('not trusted', str(e.exception))
821+
# known resaons:
822+
# Ubuntu on Travis: '(unknown error code)'
823+
# OpenSSL 1.1: error:1416F086:SSL routines:\
824+
# tls_process_server_certificate:certificate verify failed
825+
# NSS: TLS error -8172:Peer's certificate issuer has \
826+
# been marked as not trusted by the user.
827+
msg = str(e.exception)
828+
if 'certificate' not in msg and msg != '(unknown error code)':
829+
self.fail(msg)
824830

825831
@requires_tls(skip_nss=True)
826832
def test_tls_ext_clientcert(self):

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy