Backports for 0.5.4

This backports 3 bindings needed for an upcoming pyOpenSSL release.