'do_ssl_handshake with OpenSSL'

def do_ssl_handshake(self, handler):

    ssl_sock = SSLConnection(self.get_ssl_context_by_hostname(handler.host), handler.connection)
    ssl_sock.set_accept_state()
    ssl_sock.do_handshake()
    handler.connection = ssl_sock
    handler.rfile = handler.connection.makefile('rb', handler.bufsize)
    handler.wfile = handler.connection.makefile('wb', 0)
    handler.scheme = 'https'
