Skip to content

Commit 4cf2b6f

Browse files
Show message to the user after a successful certificate installation
1 parent 3190a1a commit 4cf2b6f

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

certificates/certificates.go

+7
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import (
3232
"os"
3333
"time"
3434

35+
"github.com/arduino/arduino-create-agent/utilities"
3536
"github.com/arduino/go-paths-helper"
3637
log "github.com/sirupsen/logrus"
3738
)
@@ -286,4 +287,10 @@ func GenerateAndInstallCertificates(certDir *paths.Path) {
286287
log.Errorf("cannot install certificates something went wrong: %s", err)
287288
DeleteCertificates(certDir)
288289
}
290+
expDate, err := GetExpirationDate()
291+
if err != nil {
292+
log.Errorf("cannot get certificates expiration date, something went wrong: %s", err)
293+
}
294+
infoMsg := "The Arduino Agent needs a local HTTPS certificate to work correctly with Safari.\n\nYour HTTPS certificate status:\n- Certificate installed:\t\tYes\n- Certificate trusted:\t\tYes\n- Certificate expiration:\t" + expDate.Format(time.DateTime)
295+
utilities.UserPrompt(infoMsg, "{\"OK\"}", "OK", "OK", "Arduino Agent: Manage HTTPS certificate")
289296
}

systray/systray_real.go

+2
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,8 @@ func (s *Systray) start() {
117117
if err != nil {
118118
log.Errorf("cannot set installCerts value in config.ini: %s", err)
119119
}
120+
infoMsg = "The Arduino Agent needs a local HTTPS certificate to work correctly with Safari.\n\nYour HTTPS certificate status:\n- Certificate installed:\t\tNo\n- Certificate trusted:\t\tN/A\n- Certificate expiration:\tN/A"
121+
utilities.UserPrompt(infoMsg, "{\"OK\"}", "OK", "OK", "Arduino Agent: Manage HTTPS certificate")
120122
}
121123
s.Restart()
122124
}

0 commit comments

Comments
 (0)