From ef36f7ca821b4b02c2aa95492a99ac6b197ef9ed Mon Sep 17 00:00:00 2001 From: Owen Date: Mon, 19 Jan 2026 15:05:29 -0800 Subject: [PATCH] Set fingerprint earlier --- olm/olm.go | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/olm/olm.go b/olm/olm.go index 12f804a..ec0b6dc 100644 --- a/olm/olm.go +++ b/olm/olm.go @@ -289,15 +289,28 @@ func (o *Olm) StartTunnel(config TunnelConfig) { logger.Info("Tunnel already running") return } + + // debug print out the whole config + logger.Debug("Starting tunnel with config: %+v", config) o.tunnelRunning = true // Also set it here in case it is called externally o.tunnelConfig = config // Reset terminated status when tunnel starts o.apiServer.SetTerminated(false) + + fingerprint := config.InitialFingerprint + if fingerprint == nil { + fingerprint = make(map[string]any) + } - // debug print out the whole config - logger.Debug("Starting tunnel with config: %+v", config) + postures := config.InitialPostures + if postures == nil { + postures = make(map[string]any) + } + + o.SetFingerprint(fingerprint) + o.SetPostures(postures) // Create a cancellable context for this tunnel process tunnelCtx, cancel := context.WithCancel(o.olmCtx) @@ -453,19 +466,6 @@ func (o *Olm) StartTunnel(config TunnelConfig) { } }) - fingerprint := config.InitialFingerprint - if fingerprint == nil { - fingerprint = make(map[string]any) - } - - postures := config.InitialPostures - if postures == nil { - postures = make(map[string]any) - } - - o.SetFingerprint(fingerprint) - o.SetPostures(postures) - // Connect to the WebSocket server if err := o.websocket.Connect(); err != nil { logger.Error("Failed to connect to server: %v", err)