Force 'now' to be in UTC for signing requests #1975
Merged
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.
Our server is running in
Europe/London, at26 OCT 2025 UTC 00:01:00, we had a load of errors for 1 hour:We understand the culprit to be at these lines:
aws/src/Core/src/Signer/SignerV4.php
Lines 76 to 79 in 87fd89e
At
26 OCT 2025 UTC 00:01:00, on a server set toEurope/London, DateTimeImmutable yields:Then when the timezone is updated as seen in the code:
The time is inconsistent with the real UTC time at that given moment, hence the error.
If we force the instantiation of the date to include UTC which is covered in this PR, at
26 OCT 2025 UTC 00:01:00the DateTime is instantiated as expected.Then if the timezone is set to UTC, as seen in the code, it has no effect.
We believe this would prevent the error. Unfortunately, as this relies on the system time being modified, it is very difficult to set up a unit test case to prove this behaviour.
Closes #1658