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].

Dipanjan Das 0 Reputation points
2024-01-24T07:29:36.2333333+00:00

I followed the documentation: https://docs.microsoft.com/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server to run sql server on my uḃuntu vm 22.04 All the packages and dependencies are installed my mssql-server is also running but when i want to connect with my server after entering the password am getting the error.

Sqlcmd: Error: Microsoft ODBC Driver 18 for SQL Server : SSL Provider: [error:0A000086:SSL routines::certificate verify failed:self-signed certificate]. Sqlcmd: Error: Microsoft ODBC Driver 18 for SQL Server : Client unable to establish connection. For solutions related to encryption errors, see https://go.microsoft.com/fwlink/?linkid=2226722.

Azure SQL Database
SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
14,492 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. LiHongMSFT-4306 31,081 Reputation points
    2024-01-25T02:16:24.6033333+00:00

    Hi @Dipanjan Das

    Try adding TrustServerCertificate=yes; to your connection string.

    Best regards,

    Cosmog Hong


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our Documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.
    0 comments No comments

  2. GeethaThatipatri-MSFT 29,527 Reputation points Microsoft Employee
    2024-01-24T16:18:51.3366667+00:00

    Hi, @Dipanjan Das Welcome to Microsoft Q&A thanks for posting your question.

    You can either install a certificate on your server, follow the document here (https://learn.microsoft.com/en-us/sql/linux/sql-server-linux-encrypted-connections) or disable encryption with -No option (https://learn.microsoft.com/en-us/sql/connect/odbc/linux-mac/connecting-with-sqlcmd)

    Regards

    Geetha

    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.