Skip to content

Accept more error messages in test_tls_ext_noca #92

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 4, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions Tests/t_cext.py
Original file line number Diff line number Diff line change
Expand Up @@ -818,9 +818,16 @@ def test_tls_ext_noca(self):
l.set_option(_ldap.OPT_PROTOCOL_VERSION, _ldap.VERSION3)
with self.assertRaises(_ldap.CONNECT_ERROR) as e:
l.start_tls_s()
# some platforms return '(unknown error code)' as reason
if '(unknown error code)' not in str(e.exception):
self.assertIn('not trusted', str(e.exception))
# known resaons:
# Ubuntu on Travis: '(unknown error code)'
# OpenSSL 1.1: error:1416F086:SSL routines:\
# tls_process_server_certificate:certificate verify failed
# NSS: TLS error -8172:Peer's certificate issuer has \
# been marked as not trusted by the user.
msg = str(e.exception)
candidates = ('certificate', 'tls', '(unknown error code)')
if not any(s in msg.lower() for s in candidates):
self.fail(msg)

@requires_tls(skip_nss=True)
def test_tls_ext_clientcert(self):
Expand Down