Original post

rocketlaunchr.cloud

For more than a decade, security experts have been advocating SSL certificates for servers.

For production servers you can use a SSL certificate from a reputable organization like Let’s Encrypt.

For Development (or non-public facing Production) servers, you may want to self-sign your certificates.

I’ve created a package to make it super quick and easy.

package main

import (
"log"
"net/http"
"github.com/rocketlaunchr/https-"
)

func main() {// Create a simple http hander
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusNoContent)
})
// Configure the port
httpServer, _ := Server("8080", GenerateOptions{Host: "thecucumber.app"})
// Start the server
log.Fatal(httpServer.ListenAndServeTLS("", ""))
}

Just remember to change the url from http to https. Also configure your http client code/application to allow self-signed certificates.

Repository: https://github.com/rocketlaunchr/https-go

Docs: https://github.com/rocketlaunchr/https-go