summaryrefslogtreecommitdiffhomepage
path: root/cmd
diff options
context:
space:
mode:
authorAndrew Dunham <andrew@du.nham.ca>2025-03-10 16:38:44 -0400
committerAndrew Dunham <andrew@du.nham.ca>2025-03-10 16:38:44 -0400
commit5869f14e748f2b217a82f04e3fbb6cf089bff8e3 (patch)
tree911ad8d93ea41aa0dd54d340db914a28fecbc782 /cmd
parent69b27d2fcfeaa745de072f96dd6c30f4f085ecd9 (diff)
downloadtailscale-andrew/current-time.tar.xz
tailscale-andrew/current-time.zip
net/{currenttime,tlsdial}: add minimum possible time for TLSandrew/current-time
This adds a new package, net/currenttime, which is a thin wrapper around time.Now. If the value returned by time.Now is before a hard-coded value baked into the binary, that hard-coded value will be returned instead. In the case where the system has a buggy, malfunctioning, or nonexistent RTC, this can improve the likelihood that Tailscale will be able to establish a connection to the control plane (via TLS) and fetch the server certificate. As a future TODO: we should cache this value on-disk between process starts (possibly in the state file?) so that we succeed even if the Tailscale server certificate has already expired from the perspective of the minimum time. Additionally, add a GitHub workflow that bumps the current time to a new value every 14 days, so that the value stays reasonably up-to-date in our repository without introducing impurities into the build process. Signed-off-by: Andrew Dunham <andrew@du.nham.ca> Change-Id: If63cf28c4f188993894d3de589fd65ad447def6f
Diffstat (limited to 'cmd')
-rw-r--r--cmd/derper/depaware.txt1
-rw-r--r--cmd/k8s-operator/depaware.txt1
-rw-r--r--cmd/tailscale/depaware.txt1
-rw-r--r--cmd/tailscaled/depaware.txt1
4 files changed, 4 insertions, 0 deletions
diff --git a/cmd/derper/depaware.txt b/cmd/derper/depaware.txt
index 1812a1a8d..d6ce74d72 100644
--- a/cmd/derper/depaware.txt
+++ b/cmd/derper/depaware.txt
@@ -103,6 +103,7 @@ tailscale.com/cmd/derper dependencies: (generated by github.com/tailscale/depawa
tailscale.com/kube/kubetypes from tailscale.com/envknob
tailscale.com/metrics from tailscale.com/cmd/derper+
tailscale.com/net/bakedroots from tailscale.com/net/tlsdial
+ tailscale.com/net/currenttime from tailscale.com/net/tlsdial
tailscale.com/net/dnscache from tailscale.com/derp/derphttp
tailscale.com/net/ktimeout from tailscale.com/cmd/derper
tailscale.com/net/netaddr from tailscale.com/ipn+
diff --git a/cmd/k8s-operator/depaware.txt b/cmd/k8s-operator/depaware.txt
index 54d9bd248..c3bbf043b 100644
--- a/cmd/k8s-operator/depaware.txt
+++ b/cmd/k8s-operator/depaware.txt
@@ -847,6 +847,7 @@ tailscale.com/cmd/k8s-operator dependencies: (generated by github.com/tailscale/
tailscale.com/net/bakedroots from tailscale.com/net/tlsdial+
tailscale.com/net/captivedetection from tailscale.com/ipn/ipnlocal+
tailscale.com/net/connstats from tailscale.com/net/tstun+
+ tailscale.com/net/currenttime from tailscale.com/net/tlsdial
tailscale.com/net/dns from tailscale.com/ipn/ipnlocal+
tailscale.com/net/dns/publicdns from tailscale.com/net/dns+
tailscale.com/net/dns/recursive from tailscale.com/net/dnsfallback
diff --git a/cmd/tailscale/depaware.txt b/cmd/tailscale/depaware.txt
index afe62165c..7814ea677 100644
--- a/cmd/tailscale/depaware.txt
+++ b/cmd/tailscale/depaware.txt
@@ -102,6 +102,7 @@ tailscale.com/cmd/tailscale dependencies: (generated by github.com/tailscale/dep
tailscale.com/metrics from tailscale.com/derp+
tailscale.com/net/bakedroots from tailscale.com/net/tlsdial
tailscale.com/net/captivedetection from tailscale.com/net/netcheck
+ tailscale.com/net/currenttime from tailscale.com/net/tlsdial
tailscale.com/net/dns/recursive from tailscale.com/net/dnsfallback
tailscale.com/net/dnscache from tailscale.com/control/controlhttp+
tailscale.com/net/dnsfallback from tailscale.com/control/controlhttp+
diff --git a/cmd/tailscaled/depaware.txt b/cmd/tailscaled/depaware.txt
index c0f592ea1..2e82b398c 100644
--- a/cmd/tailscaled/depaware.txt
+++ b/cmd/tailscaled/depaware.txt
@@ -297,6 +297,7 @@ tailscale.com/cmd/tailscaled dependencies: (generated by github.com/tailscale/de
tailscale.com/net/bakedroots from tailscale.com/net/tlsdial+
tailscale.com/net/captivedetection from tailscale.com/ipn/ipnlocal+
tailscale.com/net/connstats from tailscale.com/net/tstun+
+ tailscale.com/net/currenttime from tailscale.com/net/tlsdial
tailscale.com/net/dns from tailscale.com/cmd/tailscaled+
tailscale.com/net/dns/publicdns from tailscale.com/net/dns+
tailscale.com/net/dns/recursive from tailscale.com/net/dnsfallback