salt icon indicating copy to clipboard operation
salt copied to clipboard

[3006.x] Migrate to TZ-aware datetime objects in x509_v2

Open lkubb opened this issue 1 year ago • 3 comments

What does this PR do?

  • replaces datetime.utcnow with datetime.now(tz=timezone.utc)
  • generally uses TZ-aware datetimes internally
  • thus also fixes a bug in CRL creation (see linked issue)

What issues does this PR fix or reference?

Fixes: https://github.com/saltstack/salt/issues/65837 Ref: https://github.com/saltstack/salt/issues/65604

Previous Behavior

CRLs were created with wrong timestamps, Python 3.12 would log DeprecationWarnings

New Behavior

Correct CRL timestamps, no warnings

Merge requirements satisfied?

  • [ ] Docs
  • [x] Changelog - https://docs.saltproject.io/en/master/topics/development/changelog.html
  • [x] Tests written/updated ~~- not sure how to test the issue reliably tbh. A regression is unlikely since we're dealing in TZ-aware datetimes only now.~~

Commits signed with GPG?

Yes

lkubb avatar Jan 10 '24 19:01 lkubb

@dwoz can you review this one again please?

s0undt3ch avatar Apr 02 '24 17:04 s0undt3ch

Sorry for dismissing the review, had to resolve conflicts after the idna changes.

lkubb avatar Apr 17 '24 01:04 lkubb

@dwoz Anything holding this up? It should be quite straight-forward.

lkubb avatar May 02 '24 06:05 lkubb