From c81be7b899c887cdf9243b05f3391ebe76f893d3 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Fri, 20 May 2022 09:17:25 -0700 Subject: [PATCH] control/controlclient: avoid Noise protocol for js/wasm for now Updates #3157 Change-Id: I04accc09783a68257d28cadde5818bf0724a8013 Signed-off-by: Brad Fitzpatrick --- control/controlclient/direct.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/control/controlclient/direct.go b/control/controlclient/direct.go index 7d9671dfb..7985796a6 100644 --- a/control/controlclient/direct.go +++ b/control/controlclient/direct.go @@ -1097,6 +1097,12 @@ func loadServerPubKeys(ctx context.Context, httpc *http.Client, serverURL string var out tailcfg.OverTLSPublicKeyResponse jsonErr := json.Unmarshal(b, &out) if jsonErr == nil { + if runtime.GOOS == "js" { + // As of 2022-05-20 it's not possible for js/wasm to make a bidi + // Noise connection to the control plane. Instead, for now, pretend + // like the server can't do Noise to force use of the old protocol. + out.PublicKey = key.MachinePublic{} + } return &out, nil }