PYTHON-5414 Add test for hostname verification error message regression (#2385)

This commit is contained in:
Shane Harvey 2025-06-13 11:45:47 -07:00 committed by GitHub
parent e51ac1fd1c
commit c16ef0a13e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 2 deletions

View File

@ -323,7 +323,7 @@ class TestSSL(AsyncIntegrationTest):
response = await self.client.admin.command(HelloCompat.LEGACY_CMD)
with self.assertRaises(ConnectionFailure):
with self.assertRaises(ConnectionFailure) as cm:
await connected(
self.simple_client(
"server",
@ -335,6 +335,8 @@ class TestSSL(AsyncIntegrationTest):
**self.credentials, # type: ignore[arg-type]
)
)
# PYTHON-5414 Check for "module service_identity has no attribute SICertificateError"
self.assertNotIn("has no attribute", str(cm.exception))
await connected(
self.simple_client(

View File

@ -323,7 +323,7 @@ class TestSSL(IntegrationTest):
response = self.client.admin.command(HelloCompat.LEGACY_CMD)
with self.assertRaises(ConnectionFailure):
with self.assertRaises(ConnectionFailure) as cm:
connected(
self.simple_client(
"server",
@ -335,6 +335,8 @@ class TestSSL(IntegrationTest):
**self.credentials, # type: ignore[arg-type]
)
)
# PYTHON-5414 Check for "module service_identity has no attribute SICertificateError"
self.assertNotIn("has no attribute", str(cm.exception))
connected(
self.simple_client(