Skip to content

Fix https certificates being removed after downloadtool command #801

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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