From 6e1fa78278eec6e5965756a24972ec72aceb9d02 Mon Sep 17 00:00:00 2001 From: Joel Rosdahl Date: Mon, 14 Oct 2013 20:19:57 +0200 Subject: Avoid crashing due to TypeError on SSL connection error --- miniircd | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/miniircd b/miniircd index 1e48a2b..33f6867 100755 --- a/miniircd +++ b/miniircd @@ -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." % ( -- cgit v1.2.3