diff --git a/src/test/test.py b/src/test/test.py index 08b7832..d3d9056 100644 --- a/src/test/test.py +++ b/src/test/test.py @@ -254,8 +254,8 @@ def test_our_config_token_with_our_key(): .issuer_name(ca_subject) .public_key(instance_private_key.public_key()) .serial_number(x509.random_serial_number()) - .not_valid_before(datetime.utcnow() - timedelta(days=1)) - .not_valid_after(datetime.utcnow() + timedelta(days=365 * 10)) + .not_valid_before(datetime.now(tz=UTC) - timedelta(days=1)) + .not_valid_after(datetime.now(tz=UTC) + timedelta(days=365 * 10)) .add_extension(x509.BasicConstraints(ca=True, path_length=None), critical=True) .sign(instance_private_key, hashes.SHA256())) @@ -276,8 +276,8 @@ def test_our_config_token_with_our_key(): .issuer_name(issuer_name) .public_key(instance_private_key.public_key()) .serial_number(x509.random_serial_number()) - .not_valid_before(datetime.utcnow() - timedelta(days=1)) - .not_valid_after(datetime.utcnow() + timedelta(days=3650)) + .not_valid_before(datetime.now(tz=UTC) - timedelta(days=1)) + .not_valid_after(datetime.now(tz=UTC) + timedelta(days=3650)) .add_extension(x509.BasicConstraints(ca=False, path_length=None), critical=False) .sign(instance_private_key, hashes.SHA256()) )