Skip to content

Commit

Permalink
Merge pull request puppetlabs#64 from Iristyle/add-curl-retries-to-ss…
Browse files Browse the repository at this point in the history
…l.sh

(maint) Add retries to curl calls in ssl.sh
  • Loading branch information
Iristyle authored Apr 30, 2019
2 parents 151f20a + 847a107 commit 2ee8e2b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions shared/ssl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ CRLFILE="${SSLDIR}/crl.pem"
CA="https://${PUPPETSERVER_HOSTNAME}:8140/puppet-ca/v1"
CERTSUBJECT="/CN=${CERTNAME}"
CERTHEADER="-----BEGIN CERTIFICATE-----"
CURLFLAGS="--silent --show-error --cacert ${CACERTFILE}"
CURLFLAGS="--silent --show-error --cacert ${CACERTFILE} --retry 5 --retry-connrefused --retry-delay 2"

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

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

0 comments on commit 2ee8e2b

Please sign in to comment.