blob: ea09d75f260452c6ec121ec92412274722bb6841 [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 Appelbaume205d622012-07-13 18:37:21 +02009Here is an example an unprivileged user fetching the remote time:
10
11 % tlsdate -v -V -n
12 V: tlsdate version 0.0.1
13 V: We were called with the following arguments:
14 V: validate SSL certificates host = www.ptb.de:443
15 V: time is currently 1342197117.577381
16 V: using TLSv1_client_method()
17 V: SSL certificate verification passed
18 V: server time 1342197117 (difference is about 0 s) was fetched in 705 ms
19 Fri Jul 13 18:31:57 CEST 2012
20
21
Jacob Appelbaumaf07cb52012-01-18 16:09:19 +110022This is an example run - starting as root and dropping to nobody:
23
Jacob Appelbaume205d622012-07-13 18:37:21 +020024 % sudo ./tlsdate -v
25 V: tlsdate version 0.0.1
Jacob Appelbaumaf07cb52012-01-18 16:09:19 +110026 V: We were called with the following arguments:
Jacob Appelbaume205d622012-07-13 18:37:21 +020027 V: validate SSL certificates host = www.ptb.de:443
28 V: time is currently 1342197222.273552
29 V: using TLSv1_client_method()
30 V: SSL certificate verification passed
31 V: server time 1342197222 (difference is about 0 s) was fetched in 520 ms
32 V: setting time succeeded
Jacob Appelbaumb6bfa082012-01-30 03:46:22 -080033
Jacob Appelbaume205d622012-07-13 18:37:21 +020034Here is an example with a custom host and custom port without verification:
Jacob Appelbaumb6bfa082012-01-30 03:46:22 -080035
Jacob Appelbaume205d622012-07-13 18:37:21 +020036 % sudo tlsdate -v --skip-verification -p 80 -H rgnx.net
37 V: tlsdate version 0.0.1
Jacob Appelbaumb6bfa082012-01-30 03:46:22 -080038 V: We were called with the following arguments:
Jacob Appelbaume205d622012-07-13 18:37:21 +020039 V: disable SSL certificate check host = rgnx.net:80
40 WARNING: Skipping certificate verification!
41 V: time is currently 1342197285.298607
42 V: using TLSv1_client_method()
43 V: Certificate verification skipped!
44 V: server time 1342197286 (difference is about -1 s) was fetched in 765 ms
45 V: setting time succeeded
Jacob Appelbaumaf07cb52012-01-18 16:09:19 +110046
Jacob Appelbaum0a2934c2012-02-15 16:03:54 -080047Here is an example of a false ticker that is detected and rejected:
48
49 % sudo tlsdate -v -H facebook.com
Jacob Appelbaume205d622012-07-13 18:37:21 +020050 V: tlsdate version 0.0.1
Jacob Appelbaum0a2934c2012-02-15 16:03:54 -080051 V: We were called with the following arguments:
Jacob Appelbaume205d622012-07-13 18:37:21 +020052 V: validate SSL certificates host = facebook.com:443
53 V: time is currently 1342197379.931852
Jacob Appelbaum0a2934c2012-02-15 16:03:54 -080054 V: using TLSv1_client_method()
55 V: SSL certificate verification passed
Jacob Appelbaume205d622012-07-13 18:37:21 +020056 V: server time 2693501503 (difference is about -1351304124 s) was fetched in 724 ms
Jacob Appelbaum0a2934c2012-02-15 16:03:54 -080057 remote server is a false ticker from the future!
58
Jacob Appelbaum894d5272012-07-15 14:32:39 -040059Here is an example where a system may not have any kind of RTC at boot. Do the
60time warp to restore sanity:
61
Jacob Appelbaum3eecb1a2012-07-15 21:39:20 -040062 % sudo tlsdate -v -V -n -t;
63 V: tlsdate version 0.0.1
64 V: We were called with the following arguments:
65 V: validate SSL certificates host = www.ptb.de:443
66 V: RECENT_COMPILE_DATE is 1342387410.000000
67 V: time is currently 1342402415.680888
68 V: time is greater than RECENT_COMPILE_DATE
69 V: using TLSv1_client_method()
70 V: freezing time for x509 verification
71 V: remote peer provided: 1342402416, prefered over compile time: 1342387410
72 V: SSL certificate verification passed
73 V: server time 1342402416 (difference is about -1 s) was fetched in 959 ms
74 Sun Jul 15 21:33:36 EDT 2012
75