UTC-aware datetime/cryptography.x509 modernization; python >= 3.12, cryptography.x509 >= 42.0.0#211
Open
jimmbelll wants to merge 1 commit intoalexa:masterfrom
Open
UTC-aware datetime/cryptography.x509 modernization; python >= 3.12, cryptography.x509 >= 42.0.0#211jimmbelll wants to merge 1 commit intoalexa:masterfrom
jimmbelll wants to merge 1 commit intoalexa:masterfrom
Conversation
Python's cryptography.x509 library gives CryptographyDeprecationWarning, requesting a switch to not_valid_before_utc and not_valid_after_utc. Further, Python's built-in datetime.datetime.utcnow() is deprecated since python 3.12, replaced by now(datetime.UTC). These changes are required for Debian trixie's stock python 3.13.5. https://docs.python.org/3/library/datetime.html#datetime.datetime.now
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description, Motivation and Context
Review these versions carefully.
cryptography.x509 deprecates
not_valid_beforeandnot_valid_after, replacing them with the UTC-awarenot_valid_before_utcandnot_valid_after_utcwhich were added in 42.0.0.Further, Python's built-in
datetime.datetime.utcnow()is deprecated since 3.12, replaced bynow(datetime.UTC). Constantdatetime.UTCwas added in 3.11.Further still, x509's
not_valid_before_utc/not_valid_after_utcreturn UTC-aware datetime objects, which don't compare with the UTC-unaware values returned fromutcnow(). Comparing the two fails:Debian trixie (13.3) stocks python 3.13.5, which motivates these changes.
These warnings indicate that this change is required:
Another indication:
Types of changes
Checklist
License