aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/ssl.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/ssl.py')
-rw-r--r--Lib/ssl.py13
1 files changed, 4 insertions, 9 deletions
diff --git a/Lib/ssl.py b/Lib/ssl.py
index 08b2df2fc19..052a118abb4 100644
--- a/Lib/ssl.py
+++ b/Lib/ssl.py
@@ -764,15 +764,10 @@ class SSLSocket(socket):
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: