summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCory Benfield <lukasaoz@gmail.com>2016-02-10 09:50:39 +0000
committerCory Benfield <lukasaoz@gmail.com>2016-02-10 09:50:39 +0000
commit9689f4096fb9ef44c100eadac1b2ea59c553b008 (patch)
treec887078151a40f3bb011f393573b190701aba325
parenta3b9a34be9dccfc42df65b2403bc0c6666fd3392 (diff)
downloadurllib3-9689f4096fb9ef44c100eadac1b2ea59c553b008.tar.gz
Revert "Better explanation."
This reverts commit fd4c7d769653a443b1fdb54da4bc8c71ba09bfdf.
-rw-r--r--urllib3/connection.py8
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)