Skip to content

Commit

Permalink
Use not_valid_after_utc instead of the deprecated not_valid_after (#52)
Browse files Browse the repository at this point in the history
This requires Cryptography >= 42.0.0 and hence Python >= 3.7, which
is not an issue, as requests itself also requires Python >= 3.7.
  • Loading branch information
yonting authored Jan 30, 2024
1 parent fe83fb5 commit 8a84ffd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion requests_pkcs12.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
from ssl import PROTOCOL_SSLv23 as default_ssl_protocol

def _check_cert_not_after(cert):
cert_not_after = cert.not_valid_after
cert_not_after = cert.not_valid_after_utc
if cert_not_after < datetime.datetime.utcnow():
raise ValueError('Client certificate expired: Not After: {cert_not_after:%Y-%m-%d %H:%M:%SZ}'.format(**locals()))

Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
author='Volker Diels-Grabsch',
author_email='volker.diels-grabsch@m-click.aero',
license='ISC',
python_requires='>=3.6',
python_requires='>=3.7',
install_requires=[
'cryptography (>=3.4.7)',
'cryptography (>=42.0.0)',
'requests (>=2.26.0)',
],
extras_require={
Expand Down

0 comments on commit 8a84ffd

Please sign in to comment.