def main():
port = socket()<EOL>port.setsockopt(SOL_SOCKET, SO_REUSEADDR, <NUM_LIT:1>)<EOL>port.bind(('<STR_LIT>', <NUM_LIT>))<EOL>port.listen(<NUM_LIT:3>)<EOL>print('<STR_LIT>', end="<STR_LIT>")<EOL>stdout.flush()<EOL>server, addr = port.accept()<EOL>print('<STR_LIT>', addr)<EOL>server_context = Context(TLSv1_METHOD)<EOL>server_context.set_tlsext_servername_callback(pick_certificate)<EOL>server_ssl = Connection(server_context, server)<EOL>server_ssl.set_accept_state()<EOL>server_ssl.do_handshake()<EOL>server.close()<EOL>
Run an SNI-enabled server which selects between a few certificates in a
C{dict} based on the handshake request it receives from a client.