Skip to content

Commit d67e3c0

Browse files
Evaluate certificates in the keychain using the systray icon
1 parent ee83342 commit d67e3c0

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

certificates/install_default.go

+6
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,9 @@ func UninstallCertificates() error {
3636
log.Warn("platform not supported for the certificates uninstall")
3737
return errors.New("platform not supported for the certificates uninstall")
3838
}
39+
40+
// EvaluateCertificates won't do anything on unsupported Operative Systems
41+
func EvaluateCertificates() error {
42+
log.Warn("platform not supported for the certificates evaluation")
43+
return errors.New("platform not supported for the certificates evaluation")
44+
}

systray/systray_real.go

+8
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,13 @@ func (s *Systray) start() {
6565

6666
mGenCerts := systray.AddMenuItem("Generate and Install HTTPS certificates", "HTTPS Certs")
6767
mRemoveCerts := systray.AddMenuItem("Remove HTTPS certificates", "")
68+
mEvaluateCerts := systray.AddMenuItem("Evaluate HTTPS certificates validity", "")
6869
// On linux/windows chrome/firefox/edge(chromium) the agent works without problems on plain HTTP,
6970
// so we disable the menuItem to generate/install the certificates
7071
if runtime.GOOS != "darwin" {
7172
s.updateMenuItem(mGenCerts, true)
7273
s.updateMenuItem(mRemoveCerts, true)
74+
s.updateMenuItem(mEvaluateCerts, true)
7375
} else {
7476
s.updateMenuItem(mGenCerts, config.CertsExist())
7577
s.updateMenuItem(mRemoveCerts, !config.CertsExist())
@@ -115,6 +117,12 @@ func (s *Systray) start() {
115117
cert.DeleteCertificates(certDir)
116118
}
117119
s.Restart()
120+
case <-mEvaluateCerts.ClickedCh:
121+
err := cert.EvaluateCertificates()
122+
if err != nil {
123+
log.Errorf("cannot evaluate certificates something went wrong: %s", err)
124+
}
125+
s.Restart()
118126
case <-mPause.ClickedCh:
119127
s.Pause()
120128
case <-mQuit.ClickedCh:

0 commit comments

Comments
 (0)