diff --git a/README.md b/README.md index a9de572..555e1cb 100644 --- a/README.md +++ b/README.md @@ -1,25 +1,22 @@ -golang-https-example -==================== +# golang-https-example -A TLS / SSL enabled WebServer in Go, done right - includes valid https certificates. +A TLS / SSL enabled WebServer in Go, done right - includes valid https certificates. -Install -======= +# Install Install the server and some certificates ```bash # Clone this repo -git clone git@github.com:coolaj86/golang-https-example.git +git clone ssh://gitea@git.coolaj86.com:22042/coolaj86/golang-https-example.git pushd golang-https-example # Clone some valid dummy certificates -git clone git@github.com:Daplie/localhost.daplie.com-certificates.git \ - ./etc/letsencrypt/live/localhost.daplie.com/ +git clone git@example.com:example/localhost.example.com-certificates.git \ + ./etc/letsencrypt/live/localhost.rootprojects.org/ ``` -Test -==== +# Test Run the server @@ -32,24 +29,24 @@ go run serve.go \ View it in your browser - + Test it with `openssl` ```bash openssl s_client -showcerts \ -connect localhost:8443 \ - -servername localhost.daplie.com \ - -CAfile ./etc/letsencrypt/live/localhost.daplie.com/certs/ca/root.pem + -servername localhost.rootprojects.org \ + -CAfile ./etc/letsencrypt/live/localhost.rootprojects.org/certs/ca/root.pem ``` Test it with `curl` ```bash # should work -curl https://localhost.daplie.com:8443 +curl https://localhost.rootprojects.org:8443 # if the Root CA isn't in your bundle -curl https://localhost.daplie.com:8443 \ - --cacert=./etc/letsencrypt/live/localhost.daplie.com/certs/ca/root.pem +curl https://localhost.rootprojects.org:8443 \ + --cacert=./etc/letsencrypt/live/localhost.rootprojects.org/certs/ca/root.pem ``` diff --git a/serve.go b/serve.go index 64a0537..49380ff 100644 --- a/serve.go +++ b/serve.go @@ -54,7 +54,7 @@ func main() { port := flag.Uint("port", 443, "https port") certsPath := flag.String("letsencrypt-path", "/etc/letsencrypt/live", "path at which an 'xyz.example.com' containing 'fullchain.pem' and 'privkey.pem' can be found") - defaultHost := flag.String("default-hostname", "localhost.daplie.com", "the default folder to find certificates to use when no matches are found") + defaultHost := flag.String("default-hostname", "localhost.rootprojects.org", "the default folder to find certificates to use when no matches are found") flag.Parse()