func GetCertificate(domain string) autocert.Manager {
	return autocert.Manager{
		Prompt:     autocert.AcceptTOS,
		HostPolicy: autocert.HostWhitelist(domain),
	}
}
GetCertificate using autocert
package secureserver
import (
	"crypto/tls"
	"log"
	"net/http"
	"time"
	"golang.org/x/crypto/acme/autocert"
)
var CipherSuites = []uint16{
	tls.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,
	tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
	tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
	tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
	tls.TLS_RSA_WITH_AES_256_GCM_SHA384,
	tls.TLS_RSA_WITH_AES_128_GCM_SHA256,
}
var Curves = []tls.CurveID{
	tls.CurveP256,
}
func TLSConfig(domain string) *tls.Config {
	certManager := GetCertificate(domain)
	return &tls.Config{
		MinVersion:               tls.VersionTLS12,
		PreferServerCipherSuites: true,
		GetCertificate:           certManager.GetCertificate,
		CurvePreferences:         Curves,
		CipherSuites:             CipherSuites,
	}
}