File tree 1 file changed +21
-2
lines changed
1 file changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -118,9 +118,28 @@ func (s *Systray) start() {
118
118
}
119
119
s .Restart ()
120
120
case <- mEvaluateCerts .ClickedCh :
121
- err := cert .EvaluateCertificates ()
121
+ certData , err := cert .GetCertificate ()
122
122
if err != nil {
123
- log .Errorf ("cannot evaluate certificates something went wrong: %s" , err )
123
+ log .Errorf ("cannot get certificates something went wrong: %s" , err )
124
+ }
125
+ if cert .IsExpired (certData ) {
126
+ log .Info ("The certificate is expired" )
127
+ err := cert .UninstallCertificates ()
128
+ if err != nil {
129
+ log .Errorf ("cannot uninstall certificates something went wrong: %s" , err )
130
+ } else {
131
+ certDir := config .GetCertificatesDir ()
132
+ cert .DeleteCertificates (certDir )
133
+ cert .GenerateCertificates (certDir )
134
+ err := cert .InstallCertificate (certDir .Join ("ca.cert.cer" ))
135
+ // if something goes wrong during the cert install we remove them, so the user is able to retry
136
+ if err != nil {
137
+ log .Errorf ("cannot install certificates something went wrong: %s" , err )
138
+ cert .DeleteCertificates (certDir )
139
+ }
140
+ }
141
+ } else {
142
+ log .Info ("The certificate is still valid" )
124
143
}
125
144
s .Restart ()
126
145
case <- mPause .ClickedCh :
You can’t perform that action at this time.
0 commit comments