doc updates

This commit is contained in:
AJ ONeal 2020-04-27 23:09:34 -06:00
parent 3b8cdb2ae0
commit 98acb1c4f7
2 changed files with 14 additions and 17 deletions

View File

@ -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 Install the server and some certificates
```bash ```bash
# Clone this repo # 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 pushd golang-https-example
# Clone some valid dummy certificates # Clone some valid dummy certificates
git clone git@github.com:Daplie/localhost.daplie.com-certificates.git \ git clone git@example.com:example/localhost.example.com-certificates.git \
./etc/letsencrypt/live/localhost.daplie.com/ ./etc/letsencrypt/live/localhost.rootprojects.org/
``` ```
Test # Test
====
Run the server Run the server
@ -32,24 +29,24 @@ go run serve.go \
View it in your browser View it in your browser
<https://localhost.daplie.com:8443> <https://localhost.rootprojects.org:8443>
Test it with `openssl` Test it with `openssl`
```bash ```bash
openssl s_client -showcerts \ openssl s_client -showcerts \
-connect localhost:8443 \ -connect localhost:8443 \
-servername localhost.daplie.com \ -servername localhost.rootprojects.org \
-CAfile ./etc/letsencrypt/live/localhost.daplie.com/certs/ca/root.pem -CAfile ./etc/letsencrypt/live/localhost.rootprojects.org/certs/ca/root.pem
``` ```
Test it with `curl` Test it with `curl`
```bash ```bash
# should work # should work
curl https://localhost.daplie.com:8443 curl https://localhost.rootprojects.org:8443
# if the Root CA isn't in your bundle # if the Root CA isn't in your bundle
curl https://localhost.daplie.com:8443 \ curl https://localhost.rootprojects.org:8443 \
--cacert=./etc/letsencrypt/live/localhost.daplie.com/certs/ca/root.pem --cacert=./etc/letsencrypt/live/localhost.rootprojects.org/certs/ca/root.pem
``` ```

View File

@ -54,7 +54,7 @@ func main() {
port := flag.Uint("port", 443, "https port") 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") 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() flag.Parse()