Skip to content

Commit

Permalink
Allow tests to pass after 2038 (#620)
Browse files Browse the repository at this point in the history
* Allow tests to pass after 2038

in openSUSE, this broke tests in python-aiosmtplib,
python-anyio, python-cheroot, python-trio when running after 2038-01-01

Background:
As part of my work on reproducible builds for openSUSE, I check that software still gives identical build results in the future.
The usual offset is +16 years, because that is how long I expect some software will be used in some places.
This showed up failing tests in our package build.
See https://reproducible-builds.org/ for why this matters.

* Switch to previous 3000 limit

* Add news entry

---------

Co-authored-by: Quentin Pradet <quentin.pradet@gmail.com>
  • Loading branch information
bmwiedemann and pquentin committed Aug 16, 2023
1 parent 55f728a commit 044d554
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
1 change: 1 addition & 0 deletions newsfragments/620.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Set default expiry date to 3000-01-01 instead of 2038-01-01 to improve build reproducibility.
5 changes: 1 addition & 4 deletions src/trustme/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,7 @@
# OpenSSL on Windows fails if you try to give it a date after
# ~3001-01-19:
# https://github.com/pyca/cryptography/issues/3194
# Some versions of cryptography on 32-bit platforms fail if you give
# them dates after ~2038-01-19:
# https://github.com/pyca/cryptography/pull/4658
DEFAULT_EXPIRY = datetime.datetime(2038, 1, 1)
DEFAULT_EXPIRY = datetime.datetime(3000, 1, 1)

def _name(name: str, organization_name: Optional[str] = None, common_name: Optional[str] = None) -> x509.Name:
name_pieces = [
Expand Down

0 comments on commit 044d554

Please sign in to comment.