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

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

  1. 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