connection error

Blessing Zinne 20 Reputation points
2024-09-25T14:04:16.1833333+00:00

A connection was successfully established with the server, but then an error occurred during the login process. (provider: SSL Provider, error: 0 - The certificate chain was issued by an authority that is not trusted.) (Framework Microsoft SqlClient Data Provider)

That's the error i receive while trying to connect to server in my local host

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

Accepted answer
  1. Erland Sommarskog 111.2K Reputation points MVP
    2024-09-25T21:13:43.2166667+00:00

    Microsoft has the last few years changed the defaults for encryption when connecting. Previously, the default as "Optional", now it is "Mandatory". These changes are in the driver; not in SQL Server.

    The proper solution is to install a certificate on SQL Server, and this certificate should be in the Trusted Certificate store on the client. However, this is a quite an overkill for a connection on the local machine. In this case you can use TrustServerCertificate=true in the connection string. But this option is not appropriate in a corporate network when you work with sensitive data, as this permits a network admin to install a proxy that presents itself as SQL Server, but steals the data. A so-called man-in-the-middle attack.

    If you are connecting from SSMS, the option to trust the server certificate is on the front screen in SSMS 20.

    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. MikeyQiaoMSFT-0444 3,025 Reputation points
    2024-09-26T02:14:43.8266667+00:00

    Hi,Blessing Zinne

    If you are linking to SQL Server from an application, add ;TrustServerCertificate=true to the connection string.

    If you are connecting from SSMS, configure it as shown in the screenshot.User's imageRegards

    Mikey Qiao


    If you're satisfied with the answer, don't forget to "Accept it," as this will help others who have similar questions to yours.

    1 person found this answer helpful.
    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.