doc updates
This commit is contained in:
parent
3b8cdb2ae0
commit
98acb1c4f7
29
README.md
29
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
|
||||
|
||||
<https://localhost.daplie.com:8443>
|
||||
<https://localhost.rootprojects.org:8443>
|
||||
|
||||
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
|
||||
```
|
||||
|
|
2
serve.go
2
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()
|
||||
|
||||
|
|
Loading…
Reference in New Issue