blob: 1c9e793488b06f9099b301571d5aa7e5935aa1ca [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 Appelbaume205d622012-07-13 18:37:21 +020015Here is an example an unprivileged user fetching the remote time:
16
Jacob Appelbaum7a336322013-04-19 18:08:49 -070017 % tlsdate -V -n -H encrypted.google.com
18 Fri Apr 19 17:56:46 PDT 2013
Jacob Appelbaume205d622012-07-13 18:37:21 +020019
20
Jacob Appelbaum7a336322013-04-19 18:08:49 -070021This is an example run - starting as root and dropping to nobody, setting the
22clock and printing it:
Jacob Appelbaumaf07cb52012-01-18 16:09:19 +110023
Jacob Appelbaum7a336322013-04-19 18:08:49 -070024 % sudo tlsdate -V
25 Fri Apr 19 17:57:49 PDT 2013
26
Jacob Appelbaumb6bfa082012-01-30 03:46:22 -080027
Jacob Appelbaume205d622012-07-13 18:37:21 +020028Here is an example with a custom host and custom port without verification:
Jacob Appelbaumb6bfa082012-01-30 03:46:22 -080029
Jacob Appelbaume205d622012-07-13 18:37:21 +020030 % sudo tlsdate -v --skip-verification -p 80 -H rgnx.net
Jacob Appelbaum7a336322013-04-19 18:08:49 -070031 V: tlsdate version 0.0.6
Jacob Appelbaumb6bfa082012-01-30 03:46:22 -080032 V: We were called with the following arguments:
Jacob Appelbaume205d622012-07-13 18:37:21 +020033 V: disable SSL certificate check host = rgnx.net:80
34 WARNING: Skipping certificate verification!
Jacob Appelbaum7a336322013-04-19 18:08:49 -070035 V: time is currently 1366419507.456647065
36 V: time is greater than RECENT_COMPILE_DATE
Jacob Appelbaume205d622012-07-13 18:37:21 +020037 V: using TLSv1_client_method()
Jacob Appelbaum7a336322013-04-19 18:08:49 -070038 V: Using OpenSSL for SSL
39 V: opening socket to rgnx.net:80
Jacob Appelbaume205d622012-07-13 18:37:21 +020040 V: Certificate verification skipped!
Jacob Appelbaum7a336322013-04-19 18:08:49 -070041 V: public key is ready for inspection
42 V: key type: EVP_PKEY_RSA
43 V: keybits: 1024
44 V: key length appears safe
45 V: server time 1366419508 (difference is about -1 s) was fetched in 338 ms
Jacob Appelbaume205d622012-07-13 18:37:21 +020046 V: setting time succeeded
Jacob Appelbaumaf07cb52012-01-18 16:09:19 +110047
Jacob Appelbaum894d5272012-07-15 14:32:39 -040048Here is an example where a system may not have any kind of RTC at boot. Do the
Jacob Appelbaum920ea032012-07-15 22:06:02 -040049time warp to restore sanity and do so with a leap of faith:
Jacob Appelbaum894d5272012-07-15 14:32:39 -040050
Jacob Appelbaum7a336322013-04-19 18:08:49 -070051 % sudo tlsdate -V -l -t
52 Fri Apr 19 18:08:03 PDT 2013
Jacob Appelbaum3eecb1a2012-07-15 21:39:20 -040053