Search code examples
sql-server-2008dockerfilemssql-jdbc

Why is the connection to microsoft sql stopped working?


I have a service which connects with Ms Sql. The connection is running successfully from local system. But after deployment throws following error.

Could not obtain connection to query metadata : The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption. Error: "The server selected protocol version TLS10 is not accepted by client preferences [TLS13, TLS12]

The only change that was done in Dockerfile was last 3 lines:

FROM openjdk:11-jre-slim
COPY /target/app-exec.jar /app-exec.jar
RUN apt-get update && apt-get -y install wget
RUN apt-get install curl -y
RUN wget -O dd-java-agent.jar https://dtdg.co/latest-java-tracer

Even after reverting changes I am getting same error. Could you please help me with this issue?


Solution

  • Recently TLS 1.0/1.1 is not enabled by default in the upcoming versions of OpenJDK updates (since April 20)

    Quick solution for me was to downgrade version to following:

    FROM openjdk:11.0.6-jre-slim