Lesson Learned #357:Login failed due to client TLS version being less than minimal TLS version allow
Published May 26 2023 02:40 AM 5,210 Views

Today, we got a new service request with the following error message: Unable to connect to jdbc:sqlserver://XYZ.database.windows.net. Queries will be skipped for this database [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer] Reason: Login failed due to client TLS version being less than minimal TLS version allowed by the server. 

 

The error occurs because the JDBC client application or the Java container that application is running is not sending the TLS 1.2The original error for the case was resolved after properly set the  "Protocol=TLSv1.2" JVM parameter, and using the Microsoft JDBC that matches with the JavaVM  running the java code.

 

Also, you could set up using the parameter of sslProtocol=TLSv1.2 

 

		String url = String.format("jdbc:sqlserver://servername.database.windows.net:1433;database=dbname;sslProtocol=TLSv1.2;encrypt=true");
		long start = System.currentTimeMillis();
		Connection connection = DriverManager.getConnection(url, username, password);

 

 

Version history
Last update:
‎May 26 2023 02:40 AM
Updated by: