🐛 Configure curl to follow redirects (#68)

This commit is contained in:
Ben Chatelain 2024-08-01 01:36:13 -06:00 committed by GitHub
parent 8aa1a61870
commit c1a5ade76f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 4 deletions

View File

@ -488,14 +488,14 @@ if [ ! -e ${OPENSSL_ARCHIVE_FILE_NAME} ]; then
# Check whether file exists here (this is the location of the latest version for each branch) # Check whether file exists here (this is the location of the latest version for each branch)
# -s be silent, -f return non-zero exit status on failure, -I get header (do not download) # -s be silent, -f return non-zero exit status on failure, -I get header (do not download)
curl ${CURL_OPTIONS} -sfI "${OPENSSL_ARCHIVE_URL}" > /dev/null curl ${CURL_OPTIONS} -sfIL "${OPENSSL_ARCHIVE_URL}" > /dev/null
# If unsuccessful, update the URL for older versions and try again. # If unsuccessful, update the URL for older versions and try again.
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
BRANCH=$(echo "${VERSION}" | grep -Eo '^[0-9]\.[0-9]\.[0-9]') BRANCH=$(echo "${VERSION}" | grep -Eo '^[0-9]\.[0-9]\.[0-9]')
OPENSSL_ARCHIVE_URL="https://www.openssl.org/source/old/${BRANCH}/${OPENSSL_ARCHIVE_FILE_NAME}" OPENSSL_ARCHIVE_URL="https://www.openssl.org/source/old/${BRANCH}/${OPENSSL_ARCHIVE_FILE_NAME}"
curl ${CURL_OPTIONS} -sfI "${OPENSSL_ARCHIVE_URL}" > /dev/null curl ${CURL_OPTIONS} -sfIL "${OPENSSL_ARCHIVE_URL}" > /dev/null
fi fi
# Both attempts failed, so report the error # Both attempts failed, so report the error
@ -507,9 +507,9 @@ if [ ! -e ${OPENSSL_ARCHIVE_FILE_NAME} ]; then
# Archive was found, so proceed with download. # Archive was found, so proceed with download.
# -O Use server-specified filename for download # -O Use server-specified filename for download
curl ${CURL_OPTIONS} -O "${OPENSSL_ARCHIVE_URL}" curl ${CURL_OPTIONS} -OL "${OPENSSL_ARCHIVE_URL}"
# also download the gpg signature from the same location # also download the gpg signature from the same location
curl ${CURL_OPTIONS} -O "${OPENSSL_ARCHIVE_URL}${OPENSSL_ARCHIVE_SIGNATURE_FILE_EXT}" curl ${CURL_OPTIONS} -OL "${OPENSSL_ARCHIVE_URL}${OPENSSL_ARCHIVE_SIGNATURE_FILE_EXT}"
else else
echo "Using ${OPENSSL_ARCHIVE_FILE_NAME}" echo "Using ${OPENSSL_ARCHIVE_FILE_NAME}"