Prevent duplicate default SSLContext instances (#105348)
Co-authored-by: J. Nick Koston <nick@koston.org>
This commit is contained in:
parent
a090bcb8a5
commit
885410bcfc
2 changed files with 28 additions and 12 deletions
|
@ -51,3 +51,12 @@ def test_no_verify_ssl_context(mock_sslcontext) -> None:
|
|||
mock_sslcontext.set_ciphers.assert_called_with(
|
||||
SSL_CIPHER_LISTS[SSLCipherList.INTERMEDIATE]
|
||||
)
|
||||
|
||||
|
||||
def test_ssl_context_caching() -> None:
|
||||
"""Test that SSLContext instances are cached correctly."""
|
||||
|
||||
assert client_context() is client_context(SSLCipherList.PYTHON_DEFAULT)
|
||||
assert create_no_verify_ssl_context() is create_no_verify_ssl_context(
|
||||
SSLCipherList.PYTHON_DEFAULT
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue