Hi @Nishanth M
Thanks for reaching out to the Microsoft Q & A Forum.
The error occurs due to a TLS protocol mismatch between the SQL Server and the client application. This typically happens when the SQL Server instance is running on an older version, such as SQL Server 2008, 2012, or 2014, which only supports TLS 1.0/1.1. Meanwhile, the client application uses a modern Java runtime (Java 11 or later) and a newer Microsoft JDBC driver (version 9.x or higher), which require TLS 1.2 or newer and block deprecated TLS protocols. As a result, the SSL/TLS handshake fails before encryption is established, and the JDBC driver throws the generic “Unexpected rethrowing” exception.
To resolve this upgrade the SQL Server to enable TLS 1.2 support and ensure that TLS 1.2 is enabled in the Windows Schannel registry. This approach aligns with current security standards and ensures compatibility with modern encryption protocols. Once TLS 1.2 is fully enabled on the SQL Server host and its operating system, the connection will succeed seamlessly with the existing modern JDBC driver and Java runtime.
I hope this information helps. Please do let us know if you have any further queries.
Thank you