File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -64,12 +64,15 @@ func (s *Systray) start() {
6464 s .updateMenuItem (mRmCrashes , config .LogsIsEmpty ())
6565
6666 mGenCerts := systray .AddMenuItem ("Generate and Install HTTPS certificates" , "HTTPS Certs" )
67+ mRemoveCerts := systray .AddMenuItem ("Remove HTTPS certificates" , "" )
6768 // On linux/windows chrome/firefox/edge(chromium) the agent works without problems on plain HTTP,
6869 // so we disable the menuItem to generate/install the certificates
6970 if runtime .GOOS != "darwin" {
7071 s .updateMenuItem (mGenCerts , true )
72+ s .updateMenuItem (mRemoveCerts , true )
7173 } else {
7274 s .updateMenuItem (mGenCerts , config .CertsExist ())
75+ s .updateMenuItem (mRemoveCerts , ! config .CertsExist ())
7376 }
7477
7578 // Add pause/quit
@@ -103,6 +106,15 @@ func (s *Systray) start() {
103106 cert .DeleteCertificates (certDir )
104107 }
105108 s .Restart ()
109+ case <- mRemoveCerts .ClickedCh :
110+ err := cert .UninstallCertificates ()
111+ if err != nil {
112+ log .Errorf ("cannot uninstall certificates something went wrong: %s" , err )
113+ } else {
114+ certDir := config .GetCertificatesDir ()
115+ cert .DeleteCertificates (certDir )
116+ }
117+ s .Restart ()
106118 case <- mPause .ClickedCh :
107119 s .Pause ()
108120 case <- mQuit .ClickedCh :
You can’t perform that action at this time.
0 commit comments