Skip to content

Commit 2ee8e2b

Browse files
authored
Merge pull request #64 from Iristyle/add-curl-retries-to-ssl.sh
(maint) Add retries to curl calls in ssl.sh
2 parents 151f20a + 847a107 commit 2ee8e2b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

shared/ssl.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ CRLFILE="${SSLDIR}/crl.pem"
6262
CA="https://${PUPPETSERVER_HOSTNAME}:8140/puppet-ca/v1"
6363
CERTSUBJECT="/CN=${CERTNAME}"
6464
CERTHEADER="-----BEGIN CERTIFICATE-----"
65-
CURLFLAGS="--silent --show-error --cacert ${CACERTFILE}"
65+
CURLFLAGS="--silent --show-error --cacert ${CACERTFILE} --retry 5 --retry-connrefused --retry-delay 2"
6666

6767
### Print configuration for troubleshooting
6868
msg "Using configuration values:"
@@ -73,7 +73,7 @@ msg "* WAITFORCERT: '${WAITFORCERT}' seconds"
7373

7474
### Get the CA certificate for use with subsequent requests
7575
### Fail-fast if curl errors or the CA certificate can't be parsed
76-
curl --insecure --silent --show-error --output "${CACERTFILE}" "${CA}/certificate/ca"
76+
curl --insecure --silent --show-error --output "${CACERTFILE}" --retry 5 --retry-connrefused --retry-delay 2 "${CA}/certificate/ca"
7777
if [ $? -ne 0 ]; then
7878
error "cannot reach CA host '${PUPPETSERVER_HOSTNAME}'"
7979
elif ! openssl x509 -subject -issuer -noout -in "${CACERTFILE}"; then

0 commit comments

Comments
 (0)