Also switch to https for determining correct download path
This commit is contained in:
parent
d5cc504e70
commit
35951c2bdc
|
@ -384,30 +384,30 @@ OPENSSL_ARCHIVE_BASE_NAME="openssl-${VERSION}"
|
||||||
OPENSSL_ARCHIVE_FILE_NAME="${OPENSSL_ARCHIVE_BASE_NAME}.tar.gz"
|
OPENSSL_ARCHIVE_FILE_NAME="${OPENSSL_ARCHIVE_BASE_NAME}.tar.gz"
|
||||||
if [ ! -e ${OPENSSL_ARCHIVE_FILE_NAME} ]; then
|
if [ ! -e ${OPENSSL_ARCHIVE_FILE_NAME} ]; then
|
||||||
echo "Downloading ${OPENSSL_ARCHIVE_FILE_NAME}..."
|
echo "Downloading ${OPENSSL_ARCHIVE_FILE_NAME}..."
|
||||||
OPENSSL_ARCHIVE_URL="source/${OPENSSL_ARCHIVE_FILE_NAME}"
|
OPENSSL_ARCHIVE_URL="https://www.openssl.org/source/${OPENSSL_ARCHIVE_FILE_NAME}"
|
||||||
|
|
||||||
# Check whether file exists here
|
# 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 "ftp://ftp.openssl.org/${OPENSSL_ARCHIVE_URL}" > /dev/null
|
curl ${CURL_OPTIONS} -sfI "${OPENSSL_ARCHIVE_URL}" > /dev/null
|
||||||
|
|
||||||
# If unsuccessful, try the archive
|
# If unsuccessful, try the archive
|
||||||
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="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 "ftp://ftp.openssl.org/${OPENSSL_ARCHIVE_URL}" > /dev/null
|
curl ${CURL_OPTIONS} -sfI "${OPENSSL_ARCHIVE_URL}" > /dev/null
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Both attempts failed, so report the error
|
# Both attempts failed, so report the error
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "An error occurred trying to find OpenSSL ${VERSION} on ftp://ftp.openssl.org/${OPENSSL_ARCHIVE_URL}"
|
echo "An error occurred trying to find OpenSSL ${VERSION} on ${OPENSSL_ARCHIVE_URL}"
|
||||||
echo "Please verify that the version you are trying to build exists, check cURL's error message and/or your network connection."
|
echo "Please verify that the version you are trying to build exists, check cURL's error message and/or your network connection."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Archive was found, so proceed with download. Download over https
|
# 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 "https://www.openssl.org/${OPENSSL_ARCHIVE_URL}"
|
curl ${CURL_OPTIONS} -O "${OPENSSL_ARCHIVE_URL}"
|
||||||
|
|
||||||
else
|
else
|
||||||
echo "Using ${OPENSSL_ARCHIVE_FILE_NAME}"
|
echo "Using ${OPENSSL_ARCHIVE_FILE_NAME}"
|
||||||
|
|
Loading…
Reference in New Issue