Skip to content

Commit aec28eb

Browse files
authored
Fix https certificates being removed after downloadtool command (#801)
* fix https certificates being removed after `downloadtool` command * add log
1 parent 769a8e9 commit aec28eb

File tree

2 files changed

+1
-6
lines changed

2 files changed

+1
-6
lines changed

hub.go

-6
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@ import (
2626
"strconv"
2727
"strings"
2828

29-
cert "github.com/arduino/arduino-create-agent/certificates"
30-
"github.com/arduino/arduino-create-agent/config"
31-
3229
"github.com/arduino/arduino-create-agent/upload"
3330
log "github.com/sirupsen/logrus"
3431
)
@@ -183,9 +180,6 @@ func checkCmd(m []byte) {
183180
go spList(false)
184181
go spList(true)
185182
} else if strings.HasPrefix(sl, "downloadtool") {
186-
// Always delete root certificates when we receive a downloadtool command
187-
// Useful if the install procedure was not followed strictly (eg. manually)
188-
cert.DeleteCertificates(config.GetCertificatesDir())
189183
go func() {
190184
args := strings.Split(s, " ")
191185
var tool, toolVersion, pack, behaviour string

systray/systray_real.go

+1
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ func (s *Systray) start() {
101101
err := cert.InstallCertificate(certDir.Join("ca.cert.cer"))
102102
// if something goes wrong during the cert install we remove them, so the user is able to retry
103103
if err != nil {
104+
log.Errorf("cannot install certificates something went wrong: %s", err)
104105
cert.DeleteCertificates(certDir)
105106
}
106107
s.Restart()

0 commit comments

Comments
 (0)