Hi @ghazzal jastaniah Thank you for posting your question. The client and server cannot negotiate a common encryption protocol if TLS 1.3 is enabled.
You can try specifying different SSL/TLS levels like
sslProtocol=TLSv1.2
The Microsoft JDBC Driver for SQL Server supports setting the SSL protocol via the connection string.
String conURL = "jdbc:sqlserver://localhost;userName=sa;password=PASSW0RD;database=master;sslProtocol=TLS";
SQLServerConnection con = (SQLServerStatement) DriverManager.getConnection(conURL);
Another way to set the default label is using a SQLServerDataSource object.
SQLServerDataSource ds = new SQLServerDataSource();
ds.setUser("sa");
ds.setPassword("PASSWORD");
ds.setServerName("localhost");
ds.setPortNumber(1433);
ds.setDatabaseName("master");
ds.setSSLProtocol("TLS");
SQLServerConnection con = (SQLServerConnection) ds.getConnection();
TLS, TLSv1, TLSv1.1, TLSv1.2 are the supported protocol labels. The value of the property is used as the protocol on the SSLContext.getInstance method. SSLContext.getInstance method might behave differently depending on the JVM. We recommend reading about this method and the protocol labels before using the sslProtocol property. The following table demonstrates the enabled protocols with Oracle, IBM, and SAP.
Protocol Label ORACLE IBM SAP
TLS TLSv1, TLSv1.1, TLSv1.2 TLSv1 TLSv1, TLSv1.1, TLSv1.2
TLSv1 TLSv1 TLSv1 TLSv1
TLSv1.1 TLSv1.1 TLSv1.1 TLSv1, TLSv1.1
TLSv1.2 TLSv1.2 TLSv1.2 TLSv1, TLSv1.1, TLSv1.2
Regards,
Oury