1
0
mirror of https://github.com/thib8956/nginx-proxy synced 2025-07-01 22:35:45 +00:00

fix: Don't create cert error https server if https is not enabled

This commit is contained in:
Richard Hansen
2023-02-02 17:17:00 -05:00
committed by Nicolas Duchon
parent 18d0671312
commit 16066cab61
12 changed files with 483 additions and 3 deletions

View File

@ -24,10 +24,10 @@ def test_https_get_served(docker_compose, nginxproxy, subdomain):
assert f"answer from port 8{subdomain}\n" == r.text
@pytest.mark.filterwarnings('ignore::urllib3.exceptions.InsecureRequestWarning')
def test_web3_https_is_500_and_SSL_validation_fails(docker_compose, nginxproxy):
def test_https_request_to_nohttps_vhost_goes_to_fallback_server(docker_compose, nginxproxy):
with pytest.raises( (CertificateError, 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
assert r.status_code == 503