I need to get a negotiated cipher for DTLS protocol in pyOpenSSL. I was successful in doing that for TCP sockets, but when it comes to datagrams, it\'s not that obvious. Please
The result is None because that is the cipher that has been negotiated for your connection. Or rather, it is None because no cipher has been negotiated for your connection yet. Cipher selection is part of the handshake and the handshake is not done anywhere in this example.
Try con.do_handshake()
before calling SSL_get_current_cipher
.
Also bear in mind that _
-prefixed names are private and you really shouldn't use them if you want your program to keep working with future versions of pyOpenSSL.