summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio/sslproto.py
diff options
context:
space:
mode:
authorChristian Heimes <christian@python.org>2018-01-27 14:51:38 (GMT)
committerGitHub <noreply@github.com>2018-01-27 14:51:38 (GMT)
commit61d478c71c5341cdc54e6bfb4ace4252852fd972 (patch)
tree5ad17242b4c341df03664ee5cde87cdb80b0ee50 /Lib/asyncio/sslproto.py
parent746cc75541f31278864a10b995e7d009bd2ff053 (diff)
downloadcpython-61d478c71c5341cdc54e6bfb4ace4252852fd972.zip
cpython-61d478c71c5341cdc54e6bfb4ace4252852fd972.tar.gz
cpython-61d478c71c5341cdc54e6bfb4ace4252852fd972.tar.bz2
bpo-31399: Let OpenSSL verify hostname and IP address (#3462)
bpo-31399: Let OpenSSL verify hostname and IP The ssl module now uses OpenSSL's X509_VERIFY_PARAM_set1_host() and X509_VERIFY_PARAM_set1_ip() API to verify hostname and IP addresses. * Remove match_hostname calls * Check for libssl with set1_host, libssl must provide X509_VERIFY_PARAM_set1_host() * Add documentation for OpenSSL 1.0.2 requirement * Don't support OpenSSL special mode with a leading dot, e.g. ".example.org" matches "www.example.org". It's not standard conform. * Add hostname_checks_common_name Signed-off-by: Christian Heimes <christian@python.org>
Diffstat (limited to 'Lib/asyncio/sslproto.py')
-rw-r--r--Lib/asyncio/sslproto.py6
1 files changed, 0 insertions, 6 deletions
diff --git a/Lib/asyncio/sslproto.py b/Lib/asyncio/sslproto.py
index 2d377c4..1130bce 100644
--- a/Lib/asyncio/sslproto.py
+++ b/Lib/asyncio/sslproto.py
@@ -590,12 +590,6 @@ class SSLProtocol(protocols.Protocol):
raise handshake_exc
peercert = sslobj.getpeercert()
- if not hasattr(self._sslcontext, 'check_hostname'):
- # Verify hostname if requested, Python 3.4+ uses check_hostname
- # and checks the hostname in do_handshake()
- if (self._server_hostname and
- self._sslcontext.verify_mode != ssl.CERT_NONE):
- ssl.match_hostname(peercert, self._server_hostname)
except BaseException as exc:
if self._loop.get_debug():
if isinstance(exc, ssl.CertificateError):