How to Fix:Error: Microsoft ODBC Driver 18 for SQL Server : SSL Provider: [error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed:self signed certificate].

Satyam 25 Reputation points
2023-06-27T20:19:16.9633333+00:00

I followed the documentation: https://learn.microsoft.com/en-us/sql/linux/quickstart-sql-server-containers-azure?view=sql-server-ver16&tabs=kubectl to deploy SQL server on AKS. But While connecting to it, getting the below error:

Sqlcmd: Error: Microsoft ODBC Driver 18 for SQL Server : SSL Provider: [error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed:self signed certificate].

Sqlcmd: Error: Microsoft ODBC Driver 18 for SQL Server : Client unable to establish connection.

sql error

Note: My previous same question was deleted by Azure Community. This is not a good sign.

Azure SQL Database
Azure
Azure
A cloud computing platform and infrastructure for building, deploying and managing applications and services through a worldwide network of Microsoft-managed datacenters.
1,423 questions
Azure Kubernetes Service
Azure Kubernetes Service
An Azure service that provides serverless Kubernetes, an integrated continuous integration and continuous delivery experience, and enterprise-grade security and governance.
2,448 questions
SQL Server | Other
{count} votes

2 answers

Sort by: Most helpful
  1. Sreeju Nair 12,666 Reputation points
    2023-06-27T20:37:41.31+00:00

    It seems the problem is with the certificate. With ODBC driver 18.0, the default value for the Encrypt is set to true. I recommend you to read the following blog post.

    https://techcommunity.microsoft.com/t5/sql-server-blog/odbc-driver-18-0-for-sql-server-released/ba-p/3169228

    Try connecting the SQL Server instance by specifying no encryption. see the following part from the documentation that may help you.

    The action item if you are affected by the Encrypt change is to either (in order of recommendation):
    
        Install a trusted certificate on your server.
        Change your client's Encrypt connection string setting (or connection property) to optional/no.
    
    If you are using a self-signed certificate and the Force Encryption setting on the server to ensure clients connect with encryption, you will need to do one of the following (in order of recommendation):
    
        Change to a certificate that is trusted as part of the client's trust chain.
        Add the self-signed certificate as a trusted certificate on the client.
        Change your client's TrustServerCertificate connection string setting (or connection property) to yes.
    
    

    Refer: https://learn.microsoft.com/en-us/sql/tools/sqlcmd/sqlcmd-use-utility?view=sql-server-ver16


  2. Angi Wang 0 Reputation points
    2025-06-17T02:24:08.6+00:00

    In ODBC connection configuration, checked the "trust the server certificate" then pass the testing.
    User's image

    0 comments No comments

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.