7

I've noticed that connections to a secure server got reset if time is out of sync on a server.

I believe time synchronization protocols can be just as precise to the order of network latency with the external time servers, which could be as much as few hundreds of milliseconds.

What are the time precision requirements of TLS connections and certificate validation?

George Polevoy
  • 203
  • 2
  • 3
  • 6
  • I have not the time to write a proper answer at the moment, but most can tolerate up to a 5 minute delta between endpoints. – EEAA May 26 '17 at 13:52
  • 2
    AFAIK purely from the TLS perspective the server time is irrelevant and for the client you need the date/time to be *somewhere* between the "Not valid before" and "Not valid after" dates encoded in the server certificate. Of course certain server implementations may for instance refuse loading expired server certificates and require more accurate time. The protocols that run on top of TLS may require much more accuracy though. – HBruijn May 26 '17 at 14:00
  • 1
    You asked about secure protocols in the title, but you reference TLS specifically in the question. Some non-TLS VPN's use a nonce for replay prevention and don't rely on clock time at all. – Aaron May 26 '17 at 14:09
  • if you are talking about server certificate expiration, protocol itself does not mandate a skew. normally you would 1) trust the server certificate until the very second it expires but most importantly 2) every clever sysadmin renews ssl certificates far before the deadline. failing to #2 once resulted in a big halt at our company – usr-local-ΕΨΗΕΛΩΝ May 26 '17 at 17:43

1 Answers1

4

I've heard 5 minutes thrown around several times as per EEAA's comment, but I honestly don't know why (and am looking forward to an explanation).

Bear in mind this is not the TLS protocol itself that has this precision-requirement, as per the documentation:

Clocks are not required to be set correctly by the basic TLS protocol; higher-level or application protocols may define additional requirements.

G42
  • 206
  • 1
  • 4
  • 5
    AFAIK the 5 minute delta @EEAA mention finds it's origin in the [MIT Kerberos specification](http://web.mit.edu/Kerberos/krb5-1.5/krb5-1.5.4/doc/krb5-admin/Clock-Skew.html) *"In order to prevent intruders from resetting their system clocks in order to continue to use expired tickets, Kerberos V5 is set up to reject ticket requests from any host whose clock is not within the specified maximum clock skew of the KDC"* – HBruijn May 26 '17 at 14:04
  • 3
    Also Windows Technet https://technet.microsoft.com/en-us/library/jj852172(v=ws.11).aspx the 5min is default and configurable. – Jacob Evans May 29 '17 at 02:15
  • 2
    In a blogpost at [https://blog.cloudflare.com/roughtime/](https://blog.cloudflare.com/roughtime/) **10 seconds** is suggested as sufficiently accurate: *But for many applications, precise network time isn’t essential; it suffices to be accurate, say, within 10 seconds of real time* – Cie6ohpa Dec 03 '20 at 09:01