m-click / requests_pkcs12

Add PKCS#12 support to the Python requests library in a clean way, without monkey patching or temporary files
ISC License
124 stars 33 forks source link

create_ssl_sslcontext raises `TypeError: Encryption algorithm must be a KeySerializationEncryption instance` #32

Closed MWMWM closed 2 years ago

MWMWM commented 2 years ago

I get TypeError: Encryption algorithm must be a KeySerializationEncryption instance when invoking create_ssl_sslcontext function

After changing https://github.com/m-click/requests_pkcs12/blob/master/requests_pkcs12.py#L69 to cryptography.hazmat.primitives.serialization.BestAvailableEncryption(password=pkcs12_password_bytes) everything is working fine

vog commented 2 years ago

Thanks for reporting! Would you mind creating a Pull Request for your proposed fix?

MWMWM commented 2 years ago

@vog Pull Request is awaiting - will you be able to take a look?

vog commented 2 years ago

@MWMWM Thanks for the reminder and sorry for the delay!

The pull request is fine and I just released a new version 1.14 of requests_pkcs12: