Update documentation

This commit is contained in:
adnano
2020-09-28 00:29:11 -04:00
parent 21022eb5ac
commit 622ea8e0f1
3 changed files with 40 additions and 4 deletions

View File

@@ -49,15 +49,17 @@ func init() {
client.CertificateStore = gmi.NewCertificateStore()
client.GetCertificate = func(hostname string, store gmi.CertificateStore) *tls.Certificate {
// If the certificate is in the store, return it
if cert, ok := store[hostname]; ok {
return cert
}
// Generate a certificate
// Otherwise, generate a certificate
duration := time.Hour
cert, err := gmi.NewCertificate(hostname, duration)
if err != nil {
return nil
}
// Store and return the certificate
store[hostname] = &cert
return &cert
}