Skip to content

Commit bcdd23c

Browse files
authored
Merge pull request #716 from infosiftr/more-github
Upgrade to `git ls-remote` for openssl releases
2 parents 4fb9e46 + fc362c9 commit bcdd23c

File tree

9 files changed

+25
-16
lines changed

9 files changed

+25
-16
lines changed

3.12/alpine/Dockerfile

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

3.12/ubuntu/Dockerfile

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

3.13/alpine/Dockerfile

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

3.13/ubuntu/Dockerfile

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

4.0-rc/alpine/Dockerfile

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

4.0-rc/ubuntu/Dockerfile

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Dockerfile-alpine.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ RUN set -eux; \
8484
# /usr/local/src doesn't exist in Alpine by default
8585
mkdir -p /usr/local/src; \
8686
\
87-
OPENSSL_SOURCE_URL="https://www.openssl.org/source/openssl-$OPENSSL_VERSION.tar.gz"; \
87+
OPENSSL_SOURCE_URL="https://github.com/openssl/openssl/releases/download/openssl-$OPENSSL_VERSION/openssl-$OPENSSL_VERSION.tar.gz"; \
8888
OPENSSL_PATH="/usr/local/src/openssl-$OPENSSL_VERSION"; \
8989
OPENSSL_CONFIG_DIR="$OPENSSL_INSTALL_PATH_PREFIX/etc/ssl"; \
9090
\

Dockerfile-ubuntu.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ ENV OPENSSL_INSTALL_PATH_PREFIX /opt/openssl
8484
# gnupg: Required to verify OpenSSL artefacts
8585
# libncurses5-dev: Required for Erlang/OTP new shell & observer_cli - https://github.com/zhongwencool/observer_cli
8686
RUN set -eux; \
87-
OPENSSL_SOURCE_URL="https://www.openssl.org/source/openssl-$OPENSSL_VERSION.tar.gz"; \
87+
OPENSSL_SOURCE_URL="https://github.com/openssl/openssl/releases/download/openssl-$OPENSSL_VERSION/openssl-$OPENSSL_VERSION.tar.gz"; \
8888
OPENSSL_PATH="/usr/local/src/openssl-$OPENSSL_VERSION"; \
8989
OPENSSL_CONFIG_DIR="$OPENSSL_INSTALL_PATH_PREFIX/etc/ssl"; \
9090
\

versions.sh

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -123,18 +123,27 @@ for version in "${versions[@]}"; do
123123
export otpVersion otpSourceSha256
124124

125125
opensslMajor="${opensslMajors[$rcVersion]}"
126-
opensslVersion="$(
127-
wget -qO- 'https://www.openssl.org/source/' \
128-
| grep -oE 'href="openssl-'"$opensslMajor"'[^"]+[.]tar[.]gz"' \
129-
| sed -e 's/^href="openssl-//' -e 's/[.]tar[.]gz"//' \
130-
| sort -uV \
131-
| tail -1
132-
)"
126+
# grab versions from upstream and ignore any alpha/beta releases
127+
opensslVersions=( $(
128+
git ls-remote --tags https://github.com/openssl/openssl.git \
129+
"refs/tags/openssl-$opensslMajor.*"\
130+
| cut -d'/' -f3- \
131+
| cut -d'^' -f1 \
132+
| cut -d- -f2- \
133+
| grep -vE -- '-[A-Za-z]+' \
134+
| sort -urV
135+
) )
136+
opensslVersion=
137+
for possibleVersion in "${opensslVersions[@]}"; do
138+
if opensslSourceSha256="$(wget -qO- "https://github.com/openssl/openssl/releases/download/openssl-$possibleVersion/openssl-$possibleVersion.tar.gz.sha256")"; then
139+
opensslVersion="$possibleVersion"
140+
break
141+
fi
142+
done
133143
if [ -z "$opensslVersion" ]; then
134144
echo >&2 "warning: failed to get OpenSSL version for '$version' ($fullVersion); skipping"
135145
continue
136146
fi
137-
opensslSourceSha256="$(wget -qO- "https://www.openssl.org/source/openssl-$opensslVersion.tar.gz.sha256")"
138147
export opensslVersion opensslSourceSha256
139148

140149
# OpenSSL 3.0.5's sha256 file starts with a single space 😬

0 commit comments

Comments
 (0)