[Python-checkins] cpython: Issue #19509: Don't close the socket in do_handshake() when hostname
christian.heimes
python-checkins at python.org
Wed Dec 4 20:46:29 CET 2013
http://hg.python.org/cpython/rev/b6fce698e467
changeset: 87763:b6fce698e467
user: Christian Heimes <christian at cheimes.de>
date: Wed Dec 04 20:46:20 2013 +0100
summary:
Issue #19509: Don't close the socket in do_handshake() when hostname verification fails.
files:
Lib/ssl.py | 13 ++++---------
1 files changed, 4 insertions(+), 9 deletions(-)
diff --git a/Lib/ssl.py b/Lib/ssl.py
--- a/Lib/ssl.py
+++ b/Lib/ssl.py
@@ -764,15 +764,10 @@
self.settimeout(timeout)
if self.context.check_hostname:
- try:
- if not self.server_hostname:
- raise ValueError("check_hostname needs server_hostname "
- "argument")
- match_hostname(self.getpeercert(), self.server_hostname)
- except Exception:
- self.shutdown(_SHUT_RDWR)
- self.close()
- raise
+ if not self.server_hostname:
+ raise ValueError("check_hostname needs server_hostname "
+ "argument")
+ match_hostname(self.getpeercert(), self.server_hostname)
def _real_connect(self, addr, connect_ex):
if self.server_side:
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list