Skip to content

Commit

Permalink
Merge pull request tornadoweb#560 from ei-grad/master
Browse files Browse the repository at this point in the history
[trivial] Output a peer name to log message on ssl errors
  • Loading branch information
bdarnell committed Jul 14, 2012
2 parents 5edd8da + 3b56036 commit b5288cf
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tornado/iostream.py
Expand Up @@ -650,7 +650,12 @@ def _do_ssl_handshake(self):
ssl.SSL_ERROR_ZERO_RETURN):
return self.close()
elif err.args[0] == ssl.SSL_ERROR_SSL:
logging.warning("SSL Error on %d: %s", self.socket.fileno(), err)
try:
peer = self.socket.getpeername()
except:
peer = '(not connected)'
logging.warning("SSL Error on %d %s: %s",
self.socket.fileno(), peer, err)
return self.close()
raise
except socket.error, err:
Expand Down

0 comments on commit b5288cf

Please sign in to comment.