Add tests for recent fixes

pull/66/head
Jeremiah Mackey 2026-04-02 15:40:04 +00:00
parent a86dac7917
commit ffd86dea5e
1 changed files with 14 additions and 0 deletions

View File

@ -74,3 +74,17 @@ def test_load_verify_locations_with_cafile(ssl_context):
def test_load_verify_locations_with_cadata(ssl_context):
ssl_context.load_verify_locations(cadata=_CADATA)
def test_check_hostname_requires_cert_required(ssl_provider, ssl_context):
with pytest.raises(ValueError):
ssl_context.check_hostname = True
ssl_context.verify_mode = ssl_provider.CERT_REQUIRED
ssl_context.check_hostname = True
assert ssl_context.check_hostname is True
def test_wrap_socket_server_side_mismatch(ssl_context, tcp_socket):
with pytest.raises(ValueError):
ssl_context.wrap_socket(tcp_socket, server_side=True)