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

Query trusted web servers for time #78

Open
fhunleth opened this issue Jan 7, 2021 · 0 comments
Open

Query trusted web servers for time #78

fhunleth opened this issue Jan 7, 2021 · 0 comments

Comments

@fhunleth
Copy link
Collaborator

fhunleth commented Jan 7, 2021

It's possible to set the time by using the Date header in HTTPS requests. While this won't be near as accurate as NTP, it should be plenty good for TLS certificate expiration checks.

See the following links for examples of this method:

  1. sdwdate
  2. secure-time-date

The second link is basically a curl command and a regex to extract the date field:

$ curl -sI --tlsv1.2 -s https://nerves-project.org
HTTP/2 200
server: GitHub.com
content-type: text/html; charset=utf-8
last-modified: Tue, 04 Aug 2020 10:59:08 GMT
access-control-allow-origin: *
etag: "5f293f7c-ea"
expires: Thu, 07 Jan 2021 08:24:26 GMT
cache-control: max-age=600
accept-ranges: bytes
date: Thu, 07 Jan 2021 13:13:57 GMT
age: 0
content-length: 234

This feature would be intended as an alternative to using NTP, so #77 would be nice to have first.

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

No branches or pull requests

1 participant