Commit 1036a969 authored by Tomas Krizek's avatar Tomas Krizek

pytests: import test_tls_cert_hostname_mismatch (test16)

parent aaf65266
"""Tests with TLS certificates"""
import ssl
import pytest
import utils
......@@ -19,3 +23,12 @@ def test_tls_selfsigned_cert(kresd_tt, sock_family):
def test_tls_cert_hostname_mismatch(kresd_tt, sock_family):
sock, dest = kresd_tt.stream_socket(sock_family, tls=True)
ctx = utils.make_ssl_context(verify_location=kresd_tt.tls_cert_path)
ssock = ctx.wrap_socket(sock, server_hostname='wrong-host-name')
with pytest.raises(ssl.CertificateError):
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment