Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Verify local clock is in sync with the server #72

Open
javiergarza opened this issue Feb 14, 2019 · 1 comment
Open

Verify local clock is in sync with the server #72

javiergarza opened this issue Feb 14, 2019 · 1 comment

Comments

@javiergarza
Copy link
Contributor

javiergarza commented Feb 14, 2019

If the system clock drifts more than 30 seconds apart from the OPEN API Edgegrid server, the user will get an authentication error. This error not caught in almost any CLI package (most return very ugly errors) so instead of having to patch all CLI modules it would be great if the main CLI could verify this.

You can easily test if your clock is in sync by using Akamai's Time reference server time.akamai.com. See https://developer.akamai.com/legacy/learn/Akamai_Time_Reference/AkamaiTimeReference.html

For example in MacOS or linux you could run this command to verify how far apart your local clock is:
AA=curl -q http://time.akamai.com/;BB=date +%s;echo "Your time drift is: $(($AA-$BB)) seconds"

@frankthelen
Copy link

frankthelen commented Jan 22, 2021

Cool. Thanks for sharing. Did you mean curl -sS? From man pages:

-q (skip .curlrc)
-s --silent
-S --show-error

On Mac, this is working fine:

AA=$(curl -sS http://time.akamai.com);BB=$(date +%s);echo "Your time drift is: $(($AA-$BB)) seconds"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants