pytests: import test_tls_cert_expired (test17)

parent 1036a969
......@@ -32,3 +32,12 @@ def test_tls_cert_hostname_mismatch(kresd_tt, sock_family):
with pytest.raises(ssl.CertificateError):
ssock.connect(dest)
def test_tls_cert_expired(kresd_tt_expired, sock_family):
sock, dest = kresd_tt_expired.stream_socket(sock_family, tls=True)
ctx = utils.make_ssl_context(verify_location=kresd_tt_expired.tls_cert_path)
ssock = ctx.wrap_socket(sock, server_hostname='transport-test-server.com')
with pytest.raises(ssl.SSLError):
ssock.connect(dest)
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