summaryrefslogtreecommitdiff
path: root/asyncio
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2015-01-14 16:50:41 +0100
committerVictor Stinner <victor.stinner@gmail.com>2015-01-14 16:50:41 +0100
commit9d44c821817898cf8d0452080374f5d0d9c35f9d (patch)
tree3f4164a3760468192bf878c17b2f9936798a5aea /asyncio
parenta1e0e99652fe4b368a945ecc92800c28541f1182 (diff)
downloadtrollius-git-9d44c821817898cf8d0452080374f5d0d9c35f9d.tar.gz
Cleanup sslproto.py
Diffstat (limited to 'asyncio')
-rw-r--r--asyncio/sslproto.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/asyncio/sslproto.py b/asyncio/sslproto.py
index 987c158..dc03cf5 100644
--- a/asyncio/sslproto.py
+++ b/asyncio/sslproto.py
@@ -530,10 +530,11 @@ class SSLProtocol(protocols.Protocol):
self._in_handshake = False
sslobj = self._sslpipe.ssl_object
- peercert = None if handshake_exc else sslobj.getpeercert()
try:
if handshake_exc is not None:
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()