A TLS / SSL enabled WebServer in Go, done right - includes valid https certificates.
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
AJ ONeal c67b9e7fa4 ignore bin il y a 4 ans
etc/letsencrypt/live initial commit il y a 9 ans
.gitignore ignore bin il y a 4 ans
LICENSE Initial commit il y a 9 ans
README.md doc updates il y a 4 ans
serve.go doc updates il y a 4 ans

README.md

golang-https-example

A TLS / SSL enabled WebServer in Go, done right - includes valid https certificates.

Install

Install the server and some certificates

# Clone this repo
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@example.com:example/localhost.example.com-certificates.git \
  ./etc/letsencrypt/live/localhost.rootprojects.org/

Test

Run the server

# Run the Code
go run serve.go \
  --port 8443 \
  --letsencrypt-path=./etc/letsencrypt/live/

View it in your browser

https://localhost.rootprojects.org:8443

Test it with openssl

openssl s_client -showcerts \
  -connect localhost:8443 \
  -servername localhost.rootprojects.org \
  -CAfile ./etc/letsencrypt/live/localhost.rootprojects.org/certs/ca/root.pem

Test it with curl

# should work
curl https://localhost.rootprojects.org:8443

# if the Root CA isn't in your bundle
curl https://localhost.rootprojects.org:8443 \
  --cacert=./etc/letsencrypt/live/localhost.rootprojects.org/certs/ca/root.pem