mirror of
https://github.com/FiloSottile/mkcert.git
synced 2025-10-14 17:01:41 +08:00
Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
b0f7a80e95 | ||
![]() |
dbad5f86ec | ||
![]() |
779fa98126 |
@@ -54,7 +54,7 @@ $(go env GOPATH)/bin/mkcert
|
|||||||
|
|
||||||
Windows will be supported next. (PRs welcome!)
|
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
|
## Advanced topics
|
||||||
|
|
||||||
|
11
main.go
11
main.go
@@ -137,25 +137,24 @@ func getCAROOT() string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var dir string
|
var dir string
|
||||||
switch runtime.GOOS {
|
switch {
|
||||||
case "windows":
|
case runtime.GOOS == "windows":
|
||||||
dir = os.Getenv("LocalAppData")
|
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")
|
dir = os.Getenv("HOME")
|
||||||
if dir == "" {
|
if dir == "" {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
dir = filepath.Join(dir, "Library", "Application Support")
|
dir = filepath.Join(dir, "Library", "Application Support")
|
||||||
default: // Unix
|
default: // Unix
|
||||||
dir = os.Getenv("XDG_DATA_HOME")
|
|
||||||
if dir == "" {
|
|
||||||
dir = os.Getenv("HOME")
|
dir = os.Getenv("HOME")
|
||||||
if dir == "" {
|
if dir == "" {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
dir = filepath.Join(dir, ".local", "share")
|
dir = filepath.Join(dir, ".local", "share")
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return filepath.Join(dir, "mkcert")
|
return filepath.Join(dir, "mkcert")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user