Skip to content

Commit

Permalink
Fix https certificates being removed after downloadtool command (#801)
Browse files Browse the repository at this point in the history
* fix https certificates being removed after `downloadtool` command

* add log
  • Loading branch information
umbynos committed Jun 23, 2023
1 parent 769a8e9 commit aec28eb
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
6 changes: 0 additions & 6 deletions hub.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions systray/systray_real.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit aec28eb

Please sign in to comment.