1
0
mirror of https://github.com/thib8956/nginx-proxy synced 2024-12-25 03:56:31 +00:00

Catch SSLError instead of CertificateError

This commit is contained in:
Steve Kamerman 2017-11-08 22:53:44 -05:00
parent 58a02f107e
commit ebd1485b09
No known key found for this signature in database
GPG Key ID: D39F3EEFC1837DF1

View File

@ -1,6 +1,5 @@
import pytest
from backports.ssl_match_hostname import CertificateError
from requests.exceptions import SSLError
@pytest.mark.parametrize("subdomain,should_redirect_to_https", [
(1, True),
@ -23,9 +22,10 @@ def test_https_get_served(docker_compose, nginxproxy, subdomain):
def test_web3_https_is_500_and_SSL_validation_fails(docker_compose, nginxproxy):
with pytest.raises(CertificateError) as excinfo:
with pytest.raises(SSLError) as excinfo:
nginxproxy.get("https://3.web.nginx-proxy.tld/port")
assert """hostname '3.web.nginx-proxy.tld' doesn't match 'nginx-proxy.tld'""" in str(excinfo.value)
r = nginxproxy.get("https://3.web.nginx-proxy.tld/port", verify=False)
assert r.status_code == 500