How to use SSL with OCSP with GIN Framework in Go

The GIN framework comes up with the SSL middleware autotls which requests the SSL certificate on request basis. However, it lacks the cool feature of OCSP

However, the CertMagic which generates SSL certificate during initializations – so no surprises here and does support OCSP.


app := gin.Default()
...

// Assuming SSL_DOMAIN has csv domains like varunbatra.com,www.varunbatra.com
domains := os.Getenv("SSL_DOMAIN")
domainsMap := strings.Split(domains, ",")
err := certmagic.HTTPS(domainsMap, app)
if err != nil {
	log.Fatal(err)
}

How to use SSL with OCSP with GIN Framework in Go

3 thoughts on “How to use SSL with OCSP with GIN Framework in Go

  1. The ssl is in memoery? What should we do when we want to move the servers and DNS is not propagated fully? I think it will induce a lot of down time. I am in Singapore.

  2. When I read the article, I thought that there would be nothing new probably but the argument against autotls package is certainly true. Now ssl seems to be quicker than autotls alone.

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to top