Skip to content

Commit

Permalink
[tests] handle variant of error for self-signed certificates
Browse files Browse the repository at this point in the history
  • Loading branch information
jlaine committed Apr 28, 2022
1 parent 0180d53 commit cfcd3ce
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/test_tls.py
Original file line number Diff line number Diff line change
Expand Up @@ -1287,7 +1287,13 @@ def test_verify_certificate_chain_self_signed(self):
# fail
with self.assertRaises(tls.AlertBadCertificate) as cm:
verify_certificate(certificate=certificate, server_name="localhost")
self.assertEqual(str(cm.exception), "self signed certificate")
self.assertIn(
str(cm.exception),
(
"self signed certificate",
"self-signed certificate",
),
)

# ok
verify_certificate(
Expand Down

0 comments on commit cfcd3ce

Please sign in to comment.