def server(sock): conn, addr = sock.accept() sslsock = SSLSocket(conn, server_side=True, keyfile='server.pem', certfile='server.pem') cb.append(sslsock.get_channel_binding()) buf = sslsock.read() data.append(buf) conn = sslsock.unwrap() conn.close()
def server(sock): conn, addr = sock.accept() sslsock = SSLSocket(conn, server_side=True, dhparams=dhparams, ciphers='ADH+AES') buf = sslsock.read() data.append(buf) ciphers.append(sslsock.cipher()) cb.append(sslsock.get_channel_binding()) conn = sslsock.unwrap() conn.close()
def client(sock, addr): sock.connect(addr) sslsock = SSLSocket(sock, ciphers='ADH+AES') sslsock.write('foo') data.append('foo') ciphers.append(sslsock.cipher()) cb.append(sslsock.get_channel_binding()) sslsock.unwrap()
def client(sock, addr): sock.connect(addr) sslsock = SSLSocket(sock) cb.append(sslsock.get_channel_binding()) sslsock.write('foo') data.append('foo') sslsock.unwrap()