diff options
author | Joel Rosdahl <joel@rosdahl.net> | 2013-10-14 20:19:57 +0200 |
---|---|---|
committer | Joel Rosdahl <joel@rosdahl.net> | 2013-10-14 20:19:57 +0200 |
commit | 6e1fa78278eec6e5965756a24972ec72aceb9d02 (patch) | |
tree | 198af84fc447ca8eee99873e0ff6b06e6138ea4c | |
parent | 384fb8223b5dc7b58bae59aab1296b1acd80841f (diff) | |
download | miniircd-6e1fa78278eec6e5965756a24972ec72aceb9d02.tar.gz miniircd-6e1fa78278eec6e5965756a24972ec72aceb9d02.zip |
Avoid crashing due to TypeError on SSL connection error
-rwxr-xr-x | miniircd | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -759,12 +759,15 @@ class Server(object): (conn, addr) = x.accept() if self.ssl_pem_file: try: - conn = ssl.wrap_socket(conn, - server_side=True, - certfile=self.ssl_pem_file, - keyfile=self.ssl_pem_file) + conn = ssl.wrap_socket( + conn, + server_side=True, + certfile=self.ssl_pem_file, + keyfile=self.ssl_pem_file) except ssl.SSLError as e: - self.print_error('SSL error: %s\n' % (addr, e)) + self.print_error( + "SSL error for connection from %s:%s: %s" % ( + addr[0], addr[1], e)) continue self.clients[conn] = Client(self, conn) self.print_info("Accepted connection from %s:%s." % ( |