Cleanup any failed cert creation so it will be retried

This commit is contained in:
Arjan H
2022-07-31 11:16:52 +02:00
parent c8ba8e7b9d
commit eb892ba54a

View File

@@ -1917,11 +1917,15 @@ func setupHandler(w http.ResponseWriter, r *http.Request) {
// 3. Setup root CA certificate
if !_certCreate(w, r, "root-ca", true) {
// Cleanup the cert (if it even exists) so we will retry on the next run
_ := os.Remove("data/root-ca.pem")
return
}
// 4. Setup issuer certificate
if !_certCreate(w, r, "ca-int", false) {
// Cleanup the cert (if it even exists) so we will retry on the next run
_ := os.Remove("data/issuer/ca-int.pem")
return
}