diff options
-rw-r--r-- | cmd/ponzu/main.go | 8 | ||||
-rw-r--r-- | system/tls/enable.go | 1 | ||||
-rw-r--r-- | system/tls/enabledev.go | 5 |
3 files changed, 8 insertions, 6 deletions
diff --git a/cmd/ponzu/main.go b/cmd/ponzu/main.go index 9ffb433..440ce70 100644 --- a/cmd/ponzu/main.go +++ b/cmd/ponzu/main.go @@ -174,10 +174,18 @@ func main() { // cannot run production HTTPS and development HTTPS together if devhttps { fmt.Println("Enabling self-signed HTTPS... [DEV]") + go tls.EnableDev() + fmt.Println("Server listening on https://localhost:10443 for requests... [DEV]") + fmt.Println("----") + fmt.Println("If your browser rejects HTTPS requests, try allowing insecure connections on localhost.") + fmt.Println("on Chrome, visit chrome://flags/#allow-insecure-localhost") + } else if https { fmt.Println("Enabling HTTPS...") + go tls.Enable() + fmt.Println("Server listening on :443 for HTTPS requests...") } // save the port the system is listening on so internal system can make diff --git a/system/tls/enable.go b/system/tls/enable.go index 7017201..c6f65b3 100644 --- a/system/tls/enable.go +++ b/system/tls/enable.go @@ -76,5 +76,4 @@ func Enable() { } log.Fatalln(server.ListenAndServeTLS("", "")) - fmt.Println("Server listening on :443 for HTTPS requests...") } diff --git a/system/tls/enabledev.go b/system/tls/enabledev.go index 394666b..3550fc0 100644 --- a/system/tls/enabledev.go +++ b/system/tls/enabledev.go @@ -1,7 +1,6 @@ package tls import ( - "fmt" "log" "net/http" "os" @@ -27,8 +26,4 @@ func EnableDev() { key := filepath.Join(vendorPath, "devcerts", "key.pem") log.Fatalln(http.ListenAndServeTLS(":10443", cert, key, nil)) - fmt.Println("Server listening on https://localhost:10443 for requests... [DEV]") - fmt.Println("----") - fmt.Println("If your browser rejects HTTPS requests, try allowing insecure connections on localhost.") - fmt.Println("on Chrome, visit chrome://flags/#allow-insecure-localhost") } |