From e455f94f3811f6adf42e1187584ea5153d7996ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Fern=C3=A1ndez=20Aldana?= Date: Wed, 18 Dec 2024 18:47:41 +0100 Subject: [PATCH] Enhancement: make sure we use the built-in curl binary on windows (launcher) --- launcher/internal/server/httpClient.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/launcher/internal/server/httpClient.go b/launcher/internal/server/httpClient.go index 0508336..58f00d9 100644 --- a/launcher/internal/server/httpClient.go +++ b/launcher/internal/server/httpClient.go @@ -2,6 +2,9 @@ package server import ( "github.com/luskaner/ageLANServer/launcher-common/executor/exec" + "os" + "path/filepath" + "runtime" ) func HttpGet(url string, insecureSkipVerify bool) int { @@ -10,8 +13,14 @@ func HttpGet(url string, insecureSkipVerify bool) int { args = append(args, "-k") } args = append(args, url) + var file string + if runtime.GOOS == "windows" { + // Make sure we use the built-in curl on Windows so it uses the system certificate store + file = filepath.Join(os.Getenv("WINDIR"), "System32") + } + file = filepath.Join(file, "curl") result := exec.Options{ - File: "curl", + File: file, Args: args, SpecialFile: true, Wait: true,