mirror of
https://github.com/FiloSottile/mkcert.git
synced 2025-10-14 08:51:41 +08:00
Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
b0f7a80e95 | ||
![]() |
dbad5f86ec | ||
![]() |
779fa98126 | ||
![]() |
c4437d46bd | ||
![]() |
5a2f42dee6 | ||
![]() |
2e954de528 |
@@ -1,18 +0,0 @@
|
||||
class Mkcert < Formula
|
||||
desc "Simple tool to make locally-trusted development certificates"
|
||||
homepage "https://github.com/FiloSottile/mkcert"
|
||||
head "https://github.com/FiloSottile/mkcert.git"
|
||||
|
||||
depends_on "go" => :build
|
||||
|
||||
def install
|
||||
ENV["GOPATH"] = buildpath
|
||||
mkcertpath = buildpath/"src/github.com/FiloSottile/mkcert"
|
||||
mkcertpath.install buildpath.children
|
||||
cd mkcertpath do
|
||||
system "go", "build", "-o", bin/"mkcert"
|
||||
prefix.install_metafiles
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@@ -33,7 +33,7 @@ mkcert automatically creates and installs a local CA in the system root store, a
|
||||
On macOS, use Homebrew.
|
||||
|
||||
```
|
||||
brew install --HEAD https://github.com/FiloSottile/mkcert/raw/master/HomebrewFormula/mkcert.rb
|
||||
brew install mkcert
|
||||
brew install nss # if you use Firefox
|
||||
```
|
||||
|
||||
@@ -54,7 +54,7 @@ $(go env GOPATH)/bin/mkcert
|
||||
|
||||
Windows will be supported next. (PRs welcome!)
|
||||
|
||||
Warning: the `rootCA-key.pem` file that mkcert automatically generates gives complete power to intercept secure requests from your machine. Do not share it.
|
||||
> **Warning**: the `rootCA-key.pem` file that mkcert automatically generates gives complete power to intercept secure requests from your machine. Do not share it.
|
||||
|
||||
## Advanced topics
|
||||
|
||||
|
17
main.go
17
main.go
@@ -137,24 +137,23 @@ func getCAROOT() string {
|
||||
}
|
||||
|
||||
var dir string
|
||||
switch runtime.GOOS {
|
||||
case "windows":
|
||||
switch {
|
||||
case runtime.GOOS == "windows":
|
||||
dir = os.Getenv("LocalAppData")
|
||||
case "darwin":
|
||||
case os.Getenv("XDG_DATA_HOME") != "":
|
||||
dir = os.Getenv("XDG_DATA_HOME")
|
||||
case runtime.GOOS == "darwin":
|
||||
dir = os.Getenv("HOME")
|
||||
if dir == "" {
|
||||
return ""
|
||||
}
|
||||
dir = filepath.Join(dir, "Library", "Application Support")
|
||||
default: // Unix
|
||||
dir = os.Getenv("XDG_DATA_HOME")
|
||||
dir = os.Getenv("HOME")
|
||||
if dir == "" {
|
||||
dir = os.Getenv("HOME")
|
||||
if dir == "" {
|
||||
return ""
|
||||
}
|
||||
dir = filepath.Join(dir, ".local", "share")
|
||||
return ""
|
||||
}
|
||||
dir = filepath.Join(dir, ".local", "share")
|
||||
}
|
||||
return filepath.Join(dir, "mkcert")
|
||||
}
|
||||
|
@@ -97,6 +97,9 @@ func (m *mkcert) forEachNSSProfile(f func(profile string)) (found int) {
|
||||
return
|
||||
}
|
||||
for _, profile := range profiles {
|
||||
if stat, err := os.Stat(profile); err != nil || !stat.IsDir() {
|
||||
continue
|
||||
}
|
||||
if _, err := os.Stat(filepath.Join(profile, "cert8.db")); !os.IsNotExist(err) {
|
||||
f("dbm:" + profile)
|
||||
found++
|
||||
|
Reference in New Issue
Block a user