From 698d5693ace2d2635e159b791c6bfa6ef820d2aa Mon Sep 17 00:00:00 2001 From: Umberto Baldi Date: Fri, 23 Jun 2023 10:46:29 +0200 Subject: [PATCH 1/2] fix https certificates being removed after `downloadtool` command --- hub.go | 6 ------ 1 file changed, 6 deletions(-) diff --git a/hub.go b/hub.go index 003d3d959..70b1c9dd3 100755 --- a/hub.go +++ b/hub.go @@ -26,9 +26,6 @@ import ( "strconv" "strings" - cert "github.com/arduino/arduino-create-agent/certificates" - "github.com/arduino/arduino-create-agent/config" - "github.com/arduino/arduino-create-agent/upload" log "github.com/sirupsen/logrus" ) @@ -183,9 +180,6 @@ func checkCmd(m []byte) { go spList(false) go spList(true) } else if strings.HasPrefix(sl, "downloadtool") { - // Always delete root certificates when we receive a downloadtool command - // Useful if the install procedure was not followed strictly (eg. manually) - cert.DeleteCertificates(config.GetCertificatesDir()) go func() { args := strings.Split(s, " ") var tool, toolVersion, pack, behaviour string From 208dac0be83be158e6f343def29fd98576c9604b Mon Sep 17 00:00:00 2001 From: Umberto Baldi Date: Fri, 23 Jun 2023 10:46:45 +0200 Subject: [PATCH 2/2] add log --- systray/systray_real.go | 1 + 1 file changed, 1 insertion(+) diff --git a/systray/systray_real.go b/systray/systray_real.go index 74ed12c67..20db97118 100644 --- a/systray/systray_real.go +++ b/systray/systray_real.go @@ -101,6 +101,7 @@ func (s *Systray) start() { err := cert.InstallCertificate(certDir.Join("ca.cert.cer")) // if something goes wrong during the cert install we remove them, so the user is able to retry if err != nil { + log.Errorf("cannot install certificates something went wrong: %s", err) cert.DeleteCertificates(certDir) } s.Restart()