()
| 53 | } |
| 54 | |
| 55 | func (m *mkcert) installPlatform() bool { |
| 56 | if SystemTrustCommand == nil { |
| 57 | log.Printf("Installing to the system store is not yet supported on this Linux 😣 but %s will still work.", NSSBrowsers) |
| 58 | log.Printf("You can also manually install the root certificate at %q.", filepath.Join(m.CAROOT, rootName)) |
| 59 | return false |
| 60 | } |
| 61 | |
| 62 | cert, err := ioutil.ReadFile(filepath.Join(m.CAROOT, rootName)) |
| 63 | fatalIfErr(err, "failed to read root certificate") |
| 64 | |
| 65 | cmd := commandWithSudo("tee", m.systemTrustFilename()) |
| 66 | cmd.Stdin = bytes.NewReader(cert) |
| 67 | out, err := cmd.CombinedOutput() |
| 68 | fatalIfCmdErr(err, "tee", out) |
| 69 | |
| 70 | cmd = commandWithSudo(SystemTrustCommand...) |
| 71 | out, err = cmd.CombinedOutput() |
| 72 | fatalIfCmdErr(err, strings.Join(SystemTrustCommand, " "), out) |
| 73 | |
| 74 | return true |
| 75 | } |
| 76 | |
| 77 | func (m *mkcert) uninstallPlatform() bool { |
| 78 | if SystemTrustCommand == nil { |
no test coverage detected