blob: 2eccddedad2036950d65aed3345075bee4855366 [file] [log] [blame]
Jacob Appelbaum3bb69c82012-07-09 22:22:27 +02001tlsdate: secure parasitic rdate replacement
2
3 tlsdate sets the local clock by securely connecting with TLS to remote
4 servers and extracting the remote time out of the secure handshake. Unlike
5 ntpdate, tlsdate uses TCP, for instance connecting to a remote HTTPS or TLS
6 enabled service, and provides some protection against adversaries that try to
7 feed you malicious time information.
8
Jacob Appelbaumb1e5e8b2012-11-05 17:35:08 -05009On Debian GNU/Linux and related systems, we provide an init.d script that
10controls the tlsdated daemon. It will notice network changes and regularly
11invoke tlsdate to keep the clock in sync. Start it like so:
12
13 /etc/init.d/tlsdate start
14
Jacob Appelbaumcc1ccee2013-11-02 00:37:38 +010015
Jacob Appelbaume205d622012-07-13 18:37:21 +020016Here is an example an unprivileged user fetching the remote time:
17
Jacob Appelbaum7a336322013-04-19 18:08:49 -070018 % tlsdate -V -n -H encrypted.google.com
19 Fri Apr 19 17:56:46 PDT 2013
Jacob Appelbaume205d622012-07-13 18:37:21 +020020
21
Jacob Appelbaum7a336322013-04-19 18:08:49 -070022This is an example run - starting as root and dropping to nobody, setting the
23clock and printing it:
Jacob Appelbaumaf07cb52012-01-18 16:09:19 +110024
Jacob Appelbaum7a336322013-04-19 18:08:49 -070025 % sudo tlsdate -V
26 Fri Apr 19 17:57:49 PDT 2013
27
Jacob Appelbaumb6bfa082012-01-30 03:46:22 -080028
Jacob Appelbaume205d622012-07-13 18:37:21 +020029Here is an example with a custom host and custom port without verification:
Jacob Appelbaumb6bfa082012-01-30 03:46:22 -080030
Jacob Appelbaumcc1ccee2013-11-02 00:37:38 +010031 % sudo tlsdate --skip-verification -p 80 -H rgnx.net
Jacob Appelbaumaf07cb52012-01-18 16:09:19 +110032
Jacob Appelbaum894d5272012-07-15 14:32:39 -040033Here is an example where a system may not have any kind of RTC at boot. Do the
Jacob Appelbaum920ea032012-07-15 22:06:02 -040034time warp to restore sanity and do so with a leap of faith:
Jacob Appelbaum894d5272012-07-15 14:32:39 -040035
Jacob Appelbaum7a336322013-04-19 18:08:49 -070036 % sudo tlsdate -V -l -t
37 Fri Apr 19 18:08:03 PDT 2013
Jacob Appelbaum3eecb1a2012-07-15 21:39:20 -040038
Jacob Appelbaum8ae0ac52013-10-30 18:12:16 +010039
40Some SSL/TLS services do not provide accurate time in their handshake process;
41tlsdate may also be used to fetch time by processing the HTTP Date headers of
42HTTP services:
43
44 % sudo tlsdate -V -l -t -w
45 Wed Oct 30 18:08:46 CET 2013
46
Jacob Appelbaumcc1ccee2013-11-02 00:37:38 +010047