Skip to content

Commit

Permalink
switch MS OpenJDK installers to depend on deb CACerts
Browse files Browse the repository at this point in the history
  • Loading branch information
gdams committed Jul 24, 2023
1 parent fd49c69 commit 611a142
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Architecture: amd64 arm64
Depends: ca-certificates,
java-common,
libc6,
p11-kit,
zlib1g
Recommends: libasound2,
libx11-6,
Expand Down
9 changes: 6 additions & 3 deletions linux/jdk/debian/src/main/packaging/microsoft/11/debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,12 @@ override_dh_auto_install:
# Strip bundled Freetype and use OS package instead.
rm -f "$(d)/$(jvm_home)/$(jvm_dir)/lib/libfreetype.so"

# Replace bundled cacerts and redirect to adoptium-ca-certificates.
rm -f "$(d)/$(jvm_home)/$(jvm_dir)/lib/security/cacerts"
ln -s /etc/ssl/certs/adoptium/cacerts "$(d)/$(jvm_home)/$(jvm_dir)/lib/security/cacerts"
# Update "cacerts" bundle to use Debian's CA certificates and make sure it stays up-to-date with changes to Debian's store.
echo '\#!/usr/bin/env bash' > /etc/ca-certificates/update.d/docker-openjdk;
echo 'set -Eeuo pipefail' >> /etc/ca-certificates/update.d/docker-openjdk;
echo 'trust extract --overwrite --format=java-cacerts --filter=ca-anchors --purpose=server-auth "$(d)/$(jvm_home)/$(jvm_dir)/lib/security/cacerts"' >> /etc/ca-certificates/update.d/docker-openjdk;
chmod +x /etc/ca-certificates/update.d/docker-openjdk;
/etc/ca-certificates/update.d/docker-openjdk;

# Ensure src.zip is present in the root folder of the JDK.
if [ ! -f "$(d)/$(jvm_home)/$(jvm_dir)/src.zip" ]; then \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Architecture: amd64 arm64
Depends: ca-certificates,
java-common,
libc6,
p11-kit,
zlib1g
Recommends: libasound2,
libx11-6,
Expand Down
9 changes: 6 additions & 3 deletions linux/jdk/debian/src/main/packaging/microsoft/17/debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,12 @@ override_dh_auto_install:
# Strip bundled Freetype and use OS package instead.
rm -f "$(d)/$(jvm_home)/$(jvm_dir)/lib/libfreetype.so"

# Replace bundled cacerts and redirect to adoptium-ca-certificates.
rm -f "$(d)/$(jvm_home)/$(jvm_dir)/lib/security/cacerts"
ln -s /etc/ssl/certs/adoptium/cacerts "$(d)/$(jvm_home)/$(jvm_dir)/lib/security/cacerts"
# Update "cacerts" bundle to use Debian's CA certificates and make sure it stays up-to-date with changes to Debian's store.
echo '\#!/usr/bin/env bash' > /etc/ca-certificates/update.d/docker-openjdk;
echo 'set -Eeuo pipefail' >> /etc/ca-certificates/update.d/docker-openjdk;
echo 'trust extract --overwrite --format=java-cacerts --filter=ca-anchors --purpose=server-auth "$(d)/$(jvm_home)/$(jvm_dir)/lib/security/cacerts"' >> /etc/ca-certificates/update.d/docker-openjdk;
chmod +x /etc/ca-certificates/update.d/docker-openjdk;
/etc/ca-certificates/update.d/docker-openjdk;

# Ensure src.zip is present in the root folder of the JDK.
if [ ! -f "$(d)/$(jvm_home)/$(jvm_dir)/src.zip" ]; then \
Expand Down

0 comments on commit 611a142

Please sign in to comment.