I tried to build a Java 17 image based on Alpine (3.18.4).
I ran the following command:
apk upgrade --no-cache && apk add --no-cache openjdk17-jre="17.0.9_p8-r0"
When I tried to execute my container, it raised the following error:
java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
After some investigation, this problem raises if the /usr/lib/jvm/java-17-openjdk/lib/security/cacerts -> /etc/ssl/certs/java/cacerts does not exist
It looks like openjdk17-jre depends on openjdk17-jre-headless -> java-cacerts -> ca-certificates -> libcrypto3
With my libcrypto3 and libssl3 in version 3.1.3-r0, after installing the openjdk17-jre, the file /etc/ssl/certs/java/cacerts was generated
Since I upgraded libcrypto3 and libssl3 to version 3.1.4-r0, the file wasn't generated anymore.
I run the following minimal docker container you mentioned(
alpine:3.18.4
) and symlink from/usr/lib/jvm/java-17-openjdk/lib/security/cacerts -> /etc/ssl/certs/java/cacerts
was successfully created during installation of the packages. I suspect the issue somewhere else, can you provide a minimalDockerfile
which still produces thejava.security.InvalidAlgorithmParameterException
when executing ? Even when installing the latest openjdk17-jre (17.0.9_p8-r0
) the symlink is still present.