diff options
author | Cory Benfield <lukasaoz@gmail.com> | 2016-02-10 09:50:39 +0000 |
---|---|---|
committer | Cory Benfield <lukasaoz@gmail.com> | 2016-02-10 09:50:39 +0000 |
commit | 9689f4096fb9ef44c100eadac1b2ea59c553b008 (patch) | |
tree | c887078151a40f3bb011f393573b190701aba325 | |
parent | a3b9a34be9dccfc42df65b2403bc0c6666fd3392 (diff) | |
download | urllib3-9689f4096fb9ef44c100eadac1b2ea59c553b008.tar.gz |
Revert "Better explanation."
This reverts commit fd4c7d769653a443b1fdb54da4bc8c71ba09bfdf.
-rw-r--r-- | urllib3/connection.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/urllib3/connection.py b/urllib3/connection.py index e9ab8a36..6a58b7de 100644 --- a/urllib3/connection.py +++ b/urllib3/connection.py @@ -301,11 +301,9 @@ class VerifiedHTTPSConnection(HTTPSConnection): ) # In case the hostname is an IPv6 address, strip the square - # brackets from it before using it to validate. This is because - # a certificate with an IPv6 address in it won't have square - # brackets around that address. Sadly, match_hostname won't do this - # for us: it expects the plain host part without any extra work - # that might have been done to make it palatable to httplib. + # brackets from it before using it to validate. Non IPv6 addresses + # should not start/end with square brackets, so this should be + # safe. asserted_hostname = self.assert_hostname or hostname asserted_hostname = asserted_hostname.strip('[]') match_hostname(cert, asserted_hostname) |