diff options
| author | Seth Michael Larson <sethmichaellarson@gmail.com> | 2019-04-17 12:46:22 -0500 |
|---|---|---|
| committer | Andrey Petrov <andrey.petrov@shazow.net> | 2019-04-17 13:46:22 -0400 |
| commit | 1efadf43dc63317cd9eaa3e0fdb9e05ab07254b1 (patch) | |
| tree | 34f0dfde40af4843d35aadbd03b4f18b149baf94 /test/with_dummyserver/test_https.py | |
| parent | a6ec68a5c5c5743c59fe5c62c635c929586c429b (diff) | |
| download | urllib3-release.tar.gz | |
* Don't load system certificates by default when any other ``ca_certs``, ``ca_certs_dir`` or ``ssl_context`` parameters are specified.
* Remove Authorization header regardless of case when redirecting to cross-site. (Issue #1510)
* Add support for IPv6 addresses in subjectAltName section of certificates. (Issue #1269)
Diffstat (limited to 'test/with_dummyserver/test_https.py')
| -rw-r--r-- | test/with_dummyserver/test_https.py | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/test/with_dummyserver/test_https.py b/test/with_dummyserver/test_https.py index 082ede96..acc149c3 100644 --- a/test/with_dummyserver/test_https.py +++ b/test/with_dummyserver/test_https.py @@ -17,7 +17,7 @@ from dummyserver.server import (DEFAULT_CA, DEFAULT_CA_BAD, DEFAULT_CERTS, DEFAULT_CLIENT_NO_INTERMEDIATE_CERTS, NO_SAN_CERTS, NO_SAN_CA, DEFAULT_CA_DIR, IPV6_ADDR_CERTS, IPV6_ADDR_CA, HAS_IPV6, - IP_SAN_CERTS) + IP_SAN_CERTS, IPV6_SAN_CA, IPV6_SAN_CERTS) from test import ( onlyPy279OrNewer, @@ -625,5 +625,23 @@ class TestHTTPS_IPv6Addr(IPV6HTTPSDummyServerTestCase): self.assertEqual(r.status, 200) +class TestHTTPS_IPV6SAN(IPV6HTTPSDummyServerTestCase): + certs = IPV6_SAN_CERTS + + def test_can_validate_ipv6_san(self): + """Ensure that urllib3 can validate SANs with IPv6 addresses in them.""" + try: + import ipaddress # noqa: F401 + except ImportError: + pytest.skip("Only runs on systems with an ipaddress module") + + https_pool = HTTPSConnectionPool('[::1]', self.port, + cert_reqs='CERT_REQUIRED', + ca_certs=IPV6_SAN_CA) + self.addCleanup(https_pool.close) + r = https_pool.request('GET', '/') + self.assertEqual(r.status, 200) + + if __name__ == '__main__': unittest.main() |
