File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed
Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -378,8 +378,21 @@ func loop() {
378378
379379 // check if the HTTPS certificates are expired and prompt the user to update them on macOS
380380 if runtime .GOOS == "darwin" {
381- if * installCerts && config .CertsExist () {
382- cert .PromptExpiredCerts (config .GetCertificatesDir ())
381+ if * installCerts {
382+ if config .CertsExist () {
383+ cert .PromptExpiredCerts (config .GetCertificatesDir ())
384+ } else {
385+ // installing the certificates from scratch at this point should only happen if
386+ // something went wrong during previous installation attempts
387+ certDir := config .GetCertificatesDir ()
388+ cert .GenerateCertificates (certDir )
389+ err := cert .InstallCertificate (certDir .Join ("ca.cert.cer" ))
390+ // if something goes wrong during the cert install we remove them, so the user is able to retry
391+ if err != nil {
392+ log .Errorf ("cannot install certificates something went wrong: %s" , err )
393+ cert .DeleteCertificates (certDir )
394+ }
395+ }
383396 }
384397 }
385398
You can’t perform that action at this time.
0 commit comments