File tree Expand file tree Collapse file tree 1 file changed +20
-2
lines changed
Expand file tree Collapse file tree 1 file changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -378,8 +378,26 @@ 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 if cert .PromptInstallCertsSafari () {
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+ } else {
396+ err = config .SetInstallCertsIni (configPath .String (), "false" )
397+ if err != nil {
398+ log .Panicf ("config.ini cannot be parsed: %s" , err )
399+ }
400+ }
383401 }
384402 }
385403
You can’t perform that action at this time.
0 commit comments