File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -142,6 +142,15 @@ function _truststore_rotate_ca() {
142142 env=" $1 "
143143 fqdn=" $2 "
144144
145+ if [[ ! -f " truststore/ca/$env .crt" ]] ||
146+ [[ ! -f " truststore/ca/$env .key" ]] ||
147+ [[ ! -f " truststore/server/$env .pem" ]]; then
148+ echo " Error: One or more ca cert truststore files not found for environment $env - cannot rotate CA" 1>&2
149+ echo " Try running this first:" 1>&2
150+ echo " $0 pull-all $env && $0 pull-ca-key dev" 1>&2
151+ return 1
152+ fi
153+
145154 # Archive the existing ca certs
146155 archive_date=" $( date +%Y-%m-%d) "
147156 if [[ -f " truststore/ca/$env .archived_$archive_date .crt" ]] ||
@@ -176,6 +185,14 @@ function _truststore_rotate_cert() {
176185 ca_name=" $2 "
177186 fqdn=" $3 "
178187
188+ if [[ ! -f " truststore/client/$cert_name .crt" ]] ||
189+ [[ ! -f " truststore/client/$cert_name .key" ]]; then
190+ echo " Error: One or more client cert truststore files not found for $cert_name - cannot rotate client cert" 1>&2
191+ echo " Try running this first:" 1>&2
192+ echo " $0 pull-all $cert_name " 1>&2
193+ return 1
194+ fi
195+
179196 # Archive the existing client certs
180197 archive_date=$( date +%Y-%m-%d)
181198 if [[ -f " truststore/client/$cert_name .archived_$archive_date .crt" ]] ||
You can’t perform that action at this time.
0 commit comments