@@ -272,6 +272,28 @@ func InstallCertificates(certsDir *paths.Path) {
272
272
log .Errorf ("cannot install certificate in the system keychain: %s" , err )
273
273
}
274
274
log .Infof ("stdout: %s" , stdoutStderr )
275
+ // case "linux":
276
+ // stdoutStderr, err := exec.Command("sudo", "apt-get", "install", "-y", "ca-certificates").CombinedOutput()
277
+ // if err != nil {
278
+ // log.Errorf("cannot install certificate in the system keychain: %s", err)
279
+ // }
280
+ // log.Infof("stdout: %s", stdoutStderr)
281
+ // stdoutStderr, err = exec.Command("sudo", "cp", certsDir.String()+`/ca.cert.pem`, "/usr/local/share/ca-certificates").CombinedOutput()
282
+ // if err != nil {
283
+ // log.Errorf("cannot install certificate in the system keychain: %s", err)
284
+ // }
285
+ // log.Infof("stdout: %s", stdoutStderr)
286
+ // stdoutStderr, err = exec.Command("sudo", "update-ca-certificates").CombinedOutput()
287
+ // if err != nil {
288
+ // log.Errorf("cannot install certificate in the system keychain: %s", err)
289
+ // }
290
+ // log.Infof("stdout: %s", stdoutStderr)
291
+ case "windows" :
292
+ stdoutStderr , err := exec .Command ("certmgr.exe" , "-add" , certsDir .String ()+ `/ca.cert.cer` , "-s" , "-r" , "currentUser" , "root" ).CombinedOutput ()
293
+ if err != nil {
294
+ log .Errorf ("cannot install certificate in the system keychain: %s" , err )
295
+ }
296
+ log .Infof ("stdout: %s" , stdoutStderr )
275
297
default :
276
298
log .Infof ("cannot install certificate: OS not supported" )
277
299
}
0 commit comments