From 1ac4a26fee03246cbb7083f03fd9608e7dea2aed Mon Sep 17 00:00:00 2001 From: Andrew Dunham Date: Tue, 30 Aug 2022 16:48:59 -0400 Subject: [PATCH] ipn/localapi: send Tailscale version in ACME User-Agent (#5499) Requested by a friend at Let's Encrypt. Signed-off-by: Andrew Dunham --- ipn/localapi/cert.go | 6 +++++- version/version.go | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ipn/localapi/cert.go b/ipn/localapi/cert.go index a088021ee..1dbe58b23 100644 --- a/ipn/localapi/cert.go +++ b/ipn/localapi/cert.go @@ -38,6 +38,7 @@ import ( "tailscale.com/envknob" "tailscale.com/ipn/ipnstate" "tailscale.com/types/logger" + "tailscale.com/version" "tailscale.com/version/distro" ) @@ -185,7 +186,10 @@ func (h *Handler) getCertPEM(ctx context.Context, logf logger.Logf, traceACME fu if err != nil { return nil, fmt.Errorf("acmeKey: %w", err) } - ac := &acme.Client{Key: key} + ac := &acme.Client{ + Key: key, + UserAgent: "tailscaled/" + version.Long, + } a, err := ac.GetReg(ctx, "" /* pre-RFC param */) switch { diff --git a/version/version.go b/version/version.go index bec10ae9f..5def6e5bb 100644 --- a/version/version.go +++ b/version/version.go @@ -23,7 +23,8 @@ var Long = "" // Short is a short version number for this build, of the form // "x.y.z" for builds stamped in the usual way (see -// build_dist.sh in the root) or, for binaries built by hand with the // go tool, it's like Long's dev form, but ending at the date part, +// build_dist.sh in the root) or, for binaries built by hand with the +// go tool, it's like Long's dev form, but ending at the date part, // of the form "1.23.0-dev20220316". var Short = ""