RetryError: RetryError[<Future at 0x7f735f4aceb0 state=finished raised com.microsoft.sqlserver.jdbc.SQLServerException>]

Varun Chawla 1 Reputation point
2022-02-21T19:47:02.667+00:00

We are inserting data into a table in Azure SQL DB from Azure Databricks. On that function, we have applied @retry in order to retry execution after waiting for some time in case of any exception. This function sometimes fails and gives an exception given below:

com.microsoft.sqlserver.jdbc.SQLServerException: The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption. Error: "Unexpected rethrowing".

It's an intermittent issue. Can anyone please let me know the cause of it and what can be the possible solution?

Azure SQL Database
Azure Databricks
Azure Databricks
An Apache Spark-based analytics platform optimized for Azure.
2,534 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Ronen Ariely 15,206 Reputation points
    2022-02-21T22:36:46.1+00:00

    Hi,

    Make sure that you are enforcing sslProtocol=TLSv1.2; in the database connection string.

    Check this thread for another discussion on the subject:

    https://github.com/Microsoft/mssql-jdbc/issues/879


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.