Search code examples
pythonopensslpyopenssl

Initiating a renegotiation in PyOpenSSL


I need to perform a renegotiation on an open connection in python. It seems that the renegotiate function is not implemented. Is there any way I can initiate a renegotiation?

I have tried setting the connection to a connect state using set_connect_state() and then calling do_handshake, but this causes a cipher block padding error when consumed by the other end of the connection.

Thanks for your help.


Solution

  • I decided to implement the renegotiation function myself. I included OpenSSL's renegotiate function in the Cryptography binding #2303 and added this into the renegotiate function in PyOpenSSL #305, but this pull request is pending the next release of Cryptography.