On 4/5/14, Guido van Rossum <[email protected]> wrote:
> We would like to support that, but we didn't have the expertise or time to
> implement it yet. Do you want to help? Can you show a working piece of code
> that does this with synchnonous sockets? Maybe I could translate that into
> asyncio code.
Thank you...
Some straight forward pseudocode is as follows:
s = create_connection((host, port))
s = listener.accept()[0] # Or may be accepted from a listener
...
rd = s.recv(4096)
....
s.send(wrt)
...
ctx = create_default_context(Purpose.CLIENT_AUTH)
ctx.load_cert_chain('/dir/some.crt')
s = ctx.wrap_socket(s, server_side = True, do_handshake_on_connect = False)
...
s.do_handshake() # Optional if you like/need it seperate..
Regards,
Imran