Skip to content
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

PYTHON-5014 Tests that use HTTPSConnection should only use stdlib ssl #2053

Merged

Conversation

ShaneHarvey
Copy link
Member

PYTHON-5014 Tests that use HTTPSConnection should only use stdlib ssl

Attempting to fix this test failure on pyopenssl+encryption:

 [2024/12/09 09:18:59.661] FAILURE: NotImplementedError: Cannot make file object of OpenSSL.SSL.Connection ()
 [2024/12/09 09:18:59.661] self = <test.asynchronous.test_encryption.TestKmsRetryProse testMethod=test_kms_retry>
 [2024/12/09 09:18:59.661]     async def test_kms_retry(self):
 [2024/12/09 09:18:59.661] >       await self._test("aws", {"region": "foo", "key": "bar", "endpoint": "127.0.0.1:9003"})
 [2024/12/09 09:18:59.661] test/asynchronous/test_encryption.py:2924: 
 [2024/12/09 09:18:59.661] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
 [2024/12/09 09:18:59.661] test/asynchronous/test_encryption.py:2901: in _test
 [2024/12/09 09:18:59.661]     await self.http_post("/reset")
 [2024/12/09 09:18:59.661] test/asynchronous/test_encryption.py:2895: in http_post
 [2024/12/09 09:18:59.661]     res = conn.getresponse()
 [2024/12/09 09:18:59.661] /opt/python/3.13/lib/python3.13/http/client.py:1424: in getresponse
 [2024/12/09 09:18:59.661]     response = self.response_class(self.sock, method=self._method)
 [2024/12/09 09:18:59.661] /opt/python/3.13/lib/python3.13/http/client.py:269: in __init__
 [2024/12/09 09:18:59.661]     self.fp = sock.makefile("rb")
 [2024/12/09 09:18:59.661] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
 [2024/12/09 09:18:59.661] self = <pymongo.pyopenssl_context._sslConn object at 0x7f96bc700f50>
 [2024/12/09 09:18:59.661] args = ('rb',), kwargs = {}
 [2024/12/09 09:18:59.661]     def makefile(self, *args: Any, **kwargs: Any) -> typing.NoReturn:
 [2024/12/09 09:18:59.661]         """
 [2024/12/09 09:18:59.661]         The makefile() method is not implemented, since there is no dup
 [2024/12/09 09:18:59.661]         semantics for SSL connections
 [2024/12/09 09:18:59.661]     
 [2024/12/09 09:18:59.661]         :raise: NotImplementedError
 [2024/12/09 09:18:59.661]         """
 [2024/12/09 09:18:59.661] >       raise NotImplementedError(
 [2024/12/09 09:18:59.661]             "Cannot make file object of OpenSSL.SSL.Connection"
 [2024/12/09 09:18:59.661]         )
 [2024/12/09 09:18:59.661] E       NotImplementedError: Cannot make file object of OpenSSL.SSL.Connection
 [2024/12/09 09:18:59.661] .hatch/data/env/virtual/test/lib/python3.13/site-packages/OpenSSL/SSL.py:2560: NotImplementedError

https://spruce.mongodb.com/task/mongo_python_driver_encryption_pyopenssl_rhel8_python3.13_test_4.4_replica_set_noauth_ssl_sync_async_ff2f95987f945fed483dcf802082ac3a173eb905_24_12_04_00_16_47/tests?execution=0&sortBy=STATUS&sortDir=ASC

@ShaneHarvey ShaneHarvey marked this pull request as ready for review January 9, 2025 23:52
@ShaneHarvey ShaneHarvey requested a review from blink1073 January 9, 2025 23:52
Copy link
Member

@blink1073 blink1073 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@ShaneHarvey ShaneHarvey merged commit 6c9a20a into mongodb:master Jan 10, 2025
48 of 53 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants