Explorar el Código

Store renew certificate in the database.

Mariano Cano hace 7 años
padre
commit
de3ba58455
Se han modificado 1 ficheros con 7 adiciones y 0 borrados
  1. 7 0
      authority/tls.go

+ 7 - 0
authority/tls.go

@@ -202,6 +202,13 @@ func (a *Authority) Renew(oldCert *x509.Certificate) ([]*x509.Certificate, error
 			http.StatusInternalServerError, apiCtx{}}
 	}
 
+	if err = a.db.StoreCertificate(serverCert); err != nil {
+		if err != db.ErrNotImplemented {
+			return nil, &apiError{errors.Wrap(err, "error storing certificate in db"),
+				http.StatusInternalServerError, apiCtx{}}
+		}
+	}
+
 	return []*x509.Certificate{serverCert, caCert}, nil
 }