-
Notifications
You must be signed in to change notification settings - Fork 476
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
9-jdk image has SSL issues #145
Comments
The same test with 9-jre fails with
|
Faced same issue today with latest image 9-jdk |
Works fine with |
Seeing this downstream with a Maven project on Bitbucket's pipelines. |
Easy reproducer with maven image in carlossg/docker-maven#50
|
Seeing this in the current 9-jre image as well. |
I got this issue as well |
https://twitter.com/CedricChampeau/status/913679310896156672 |
My workaround to this: I have JDK 8 installed. I went in to JDK9_HOME/lib/security and did:
Problem solved. The cacerts file that comes with 181 is empty. After making that fix, Maven works as expected. |
@chiralsoftware, I apparently don't understand how that fixes it; the file $ docker run -it --rm openjdk:9-jdk bash
root@c555aa9be1c4:/# find / -name cacerts
/etc/default/cacerts
/etc/ssl/certs/java/cacerts
/usr/lib/jvm/java-9-openjdk-amd64/lib/security/cacerts
root@c555aa9be1c4:/# ls -l /usr/lib/jvm/java-9-openjdk-amd64/lib/security/cacerts
lrwxrwxrwx 1 root root 27 Aug 24 17:15 /usr/lib/jvm/java-9-openjdk-amd64/lib/security/cacerts -> /etc/ssl/certs/java/cacerts
root@c555aa9be1c4:/# exit |
@yosifkit , I installed from the .tar.gz file
That did not create the link when I untarred it. Creating that link fixed it. I haven't tried the other package files. |
@chiralsoftware, I understand, this image uses the Debian packaging for openjdk, not the tar-gz file directly (we get many more architectures that way). |
I did much regression testing using snapshot.debian.org to install openjdk-9-jdk at the same version, diff /tmp/0906-java.txt /tmp/0907-java.txt
94c94,95
< ii libegl1-mesa:amd64 17.1.5-1 amd64 free implementation of the EGL API -- runtime
---
> ii libegl-mesa0:amd64 17.2.0-1 amd64 free implementation of the EGL API -- Mesa vendor library
> ii libegl1:amd64 0.2.999+git20170802-3 amd64 Vendor neutral GL dispatch library -- EGL support
105c106
< ii libgbm1:amd64 17.1.5-1 amd64 generic buffer management API -- runtime
---
> ii libgbm1:amd64 17.2.0-1 amd64 generic buffer management API -- runtime
112,114c113,116
< ii libgl1-mesa-dri:amd64 17.1.5-1 amd64 free implementation of the OpenGL API -- DRI modules
< ii libgl1-mesa-glx:amd64 17.1.5-1 amd64 free implementation of the OpenGL API -- GLX runtime
< ii libglapi-mesa:amd64 17.1.5-1 amd64 free implementation of the GL API -- shared library
---
> ii libgl1:amd64 0.2.999+git20170802-3 amd64 Vendor neutral GL dispatch library -- legacy GL support
> ii libgl1-mesa-dri:amd64 17.2.0-1 amd64 free implementation of the OpenGL API -- DRI modules
> ii libgl1-mesa-glx 17.2.0-1 amd64 transitional dummy package
> ii libglapi-mesa:amd64 17.2.0-1 amd64 free implementation of the GL API -- shared library
116a119,121
> ii libglvnd0:amd64 0.2.999+git20170802-3 amd64 Vendor neutral GL dispatch library
> ii libglx-mesa0:amd64 17.2.0-1 amd64 free implementation of the OpenGL API -- GLX vendor library
> ii libglx0:amd64 0.2.999+git20170802-3 amd64 Vendor neutral GL dispatch library -- GLX support
144c149
< ii libllvm4.0:amd64 1:4.0.1-3 amd64 Modular compiler and toolchain technologies, runtime library
---
> ii libllvm5.0:amd64 1:5.0-1 amd64 Modular compiler and toolchain technologies, runtime library
199c204
< ii libwayland-egl1-mesa:amd64 17.1.5-1 amd64 implementation of the Wayland EGL platform -- runtime
---
> ii libwayland-egl1-mesa:amd64 17.2.0-1 amd64 implementation of the Wayland EGL platform -- runtime I don't really know which of these packages could affect the java ca-certificates file generation. 😕 |
The same on my Fedora 26. Making a symlink to upd: not really helped |
@fdesu @chiralsoftware please take discussions of upstream's broken release tarball elsewhere; this issue is discussing a separate issue with the |
Given @yosifkit's diff in #145 (comment), it appears this is somehow related to OpenGL, which is bizarre. That diff (with the timestamps for http://snapshot.debian.org) is probably enough for filing an issue in Debian (https://bugs.debian.org/src:openjdk-9) to see if the Debian Java team can make heads or tails of what's going on here (and why it works with |
having the same problem. would be nice if this could be fixed. thanks. gradlew for example doesnt work making ci builds impossible. |
or does anyone know a fix for this? |
@freakyy85 Is it possible for your CI builder to use one of the -slim ones? I switched to 9-jdk-slim to fix my builds. |
oh yes i can. thanks the slim versions have fixed everything!! :) |
@philwebb, you are right, cacerts keystore is empty in OpenJDK 9. It is a known issue, see here for more details. |
One part of the upstream issue is resolved, see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=894979 . |
This patch can be reverted once Debian Stable (Stretch) has backported the fix mentioned in https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=894979 . See docker-library/openjdk#145 (comment)
Hello... what's the ETA for resolving this issue? I am having the same issue with java 9 in docker javax.net.ssl.SSLException: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
at java.base/sun.security.ssl.Alerts.getSSLException(Alerts.java:214) ~[na:na]
at java.base/sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1969) ~[na:na]
at java.base/sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1921) ~[na:na]
at java.base/sun.security.ssl.SSLSocketImpl.handleException(SSLSocketImpl.java:1904) ~[na:na]
at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1436) ~[na:na]
at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1413) ~[na:na]
at org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:396) ~[httpclient-4.5.5.jar!/:4.5.5] |
Well, it's been resolved in upstream, because rebuilding 9-jdk from what's in the repo currently produces a working cacerts file. We'd only need someone to rebuild and reupload the official docker-library images. |
Doing However, this rebuild will happen following the merge of docker-library/official-images#4281. |
Somewhat off topic: the new 🔥 Ubuntu 1770553: [SRU] backport ca-certificates-java from cosmic (20180413ubuntu1) 🤘 Ubuntu 1769013: Please merge ca-certificates-java 20180413 (main) from Debian unstable (main) 🤘 Ubuntu 1739631: Fresh install with JDK 9 can't use the generated PKCS12 cacerts keystore file 🛠️ Debian ca-certificates-java ChangeLog 💥 JDK-8044445 : JEP 229: Create PKCS12 Keystores by Default 💣 JEP 229: Create PKCS12 Keystores by Default WorkaroundUsed @kurtbrose's /usr/bin/printf '\xfe\xed\xfe\xed\x00\x00\x00\x02\x00\x00\x00\x00\xe2\x68\x6e\x45\xfb\x43\xdf\xa4\xd9\x92\xdd\x41\xce\xb6\xb2\x1c\x63\x30\xd7\x92' > /etc/ssl/certs/java/cacerts
/var/lib/dpkg/info/ca-certificates-java.postinst configure |
Another workaround with all certificates available (from https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=894979)
|
Verified that the image Repro steps: docker pull openjdk:9-jdk
docker run -it --rm openjdk:9-jdk bash
wget https://github.com/mikaelhg/broken-docker-jdk9-cacerts/raw/master/TestHttps.class
java -cp . TestHttps "https://www.google.com/" No stack trace == success. (Also verified current |
Awesome, thanks @mikaelhg! |
This work for me (React Native Stack for Android) sudo apt install openjdk-8-jre |
Thanks abelhOrihuela!! it's work now!!! |
…d директории, по умолчанию в текущей директории. Workaround for java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty: - https://stackoverflow.com/questions/43483514/how-to-pass-truststore-property-in-gradle-build-script - docker-library/openjdk#145 - https://gist.github.com/mikaelhg/527204e746984cf9a33f7910bb8b4cb6 - https://stackoverflow.com/questions/6784463/error-trustanchors-parameter-must-be-non-empty
I found that by doing an update and upgrade of apt-get, the ca-certs end up being updated and so the SSL issues were fixed |
It seems that openjdk:11.0.1-jre-slim does not work with custom truststores( |
@heroInCommunity, it sounds like it's a different issue, so your best bet might be to open a new issue and include a reproduction. If you do, please tag me in a comment or something, as I'll need to devise a workaround if the fix is a long time coming. |
9-b179-jdk image works fine, but the latest 9-jdk image is unable to make SSL connections in Java.
Here's how you can see the issue, create TestHttps.java with
and run
You'll get
The text was updated successfully, but these errors were encountered: