From ea457fac2e270c258172be65a0eeb4701ad23d8e Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Mon, 25 Jun 2012 16:16:01 +1200 Subject: Perform handshake immediately on SSL conversion. Otherwise the handshake happens at first write, which can balls up if either side hangs immediately. --- netlib/tcp.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'netlib/tcp.py') diff --git a/netlib/tcp.py b/netlib/tcp.py index 3c5c89b7..276d3162 100644 --- a/netlib/tcp.py +++ b/netlib/tcp.py @@ -59,6 +59,7 @@ class TCPClient: context.use_certificate_file(self.clientcert) self.connection = SSL.Connection(context, self.connection) self.connection.set_connect_state() + self.connection.do_handshake() self.cert = self.connection.get_peer_certificate() self.rfile = FileLike(self.connection) self.wfile = FileLike(self.connection) @@ -95,6 +96,7 @@ class BaseHandler: ctx.use_certificate_file(cert) self.connection = SSL.Connection(ctx, self.connection) self.connection.set_accept_state() + self.connection.do_handshake() self.rfile = FileLike(self.connection) self.wfile = FileLike(self.connection) -- cgit v1.2.3