I have a Spring Boot app where it connects to the database which is not inside the container. After I build the image and run I get following exception:
Caused by: javax.net.ssl.SSLHandshakeException: The server selected protocol version TLS10 is not accepted by client preferences [TLS13, TLS12]
at java.base/sun.security.ssl.Alert.createSSLException(Unknown Source) ~[na:na]
at java.base/sun.security.ssl.Alert.createSSLException(Unknown Source) ~[na:na]
at java.base/sun.security.ssl.TransportContext.fatal(Unknown Source) ~[na:na]
at java.base/sun.security.ssl.TransportContext.fatal(Unknown Source) ~[na:na]
at java.base/sun.security.ssl.TransportContext.fatal(Unknown Source) ~[na:na]
at java.base/sun.security.ssl.ServerHello$ServerHelloConsumer.onServerHello(Unknown Source) ~[na:na]
at java.base/sun.security.ssl.ServerHello$ServerHelloConsumer.consume(Unknown Source) ~[na:na]
In my docker file I tired to updated the https.protocols to TLSv1.2 like below, but is not working as expected:
FROM adoptopenjdk/openjdk11:alpine-jre
ARG JAR_FILE=target/portal-0.0.1-SNAPSHOT.jar
WORKDIR /appPortal
COPY ${JAR_FILE} portal.jar
ENTRYPOINT ["java","-Dcom.ibm.jsse2.overrideDefaultTLS = true","-Djdk.tls.client.protocols =
TLSv1.2","-Dhttps.protocols = TLSv1.2","-jar","portal.jar"]
maybe I'm trying to set tls versions incorrectly, any advice on this?