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

`cryptography.x509.Certificate.not_valid_after` is deprecated #51

Closed yonting closed 9 months ago

yonting commented 9 months ago

cryptography.x509.Certificate.not_valid_after is deprecated since version 42.0.0. It is used in library:

https://github.com/m-click/requests_pkcs12/blob/fe83fb58785f884fbe69e8466e9d66aae0069272/requests_pkcs12.py#L38

It can use cryptography.x509.Certificate.not_valid_after_utc instead but then need cryptography>= 42.0.0 in setup.py.

What are you thinking?

I can do a PR.

yonting commented 9 months ago

Did a PR if you want the change.

vog commented 9 months ago

Thanks for your contribution. I accepted it as-is, but had to apply another fix to solve the following error:

TypeError: can't compare offset-naive and offset-aware datetimes

(see above)

vog commented 9 months ago

I just released a new version requests-pkcs12 1.23 that contains your fix:

Again, thanks for your contribution!