How to fix; System.ComponentModel.Win32Exception: The certificate chain was issued by an authority that is not trusted

Kenneth Fromm 0 Reputation points
2023-02-16T17:34:12.2866667+00:00

This error is popping up when trying to connect to a site with an app. It is trying to connect to a SQL database. We tried adding trustecertificate=true to the connection string. This works for a bit but reverts the changes after a bit. What can we do to get this fixed?

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
Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
13,726 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Seeya Xi-MSFT 16,571 Reputation points
    2023-02-17T07:09:37.2866667+00:00

    Hi @Kenneth Fromm ,

    Please refer to this document: https://learn.microsoft.com/en-us/troubleshoot/sql/database-engine/connect/certificate-chain-not-trusted?tabs=ole-db-driver-19

    Hope this would give you some help.

    If the issue persists, you may need to configure the SQL Server to use a different SSL certificate that is issued by a trusted CA. This will require generating a new SSL certificate, importing it into the certificate store on the SQL Server, and updating the SSL settings for the SQL Server instance.

    Best regards,

    Seeya


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


  2. Erland Sommarskog 119.9K Reputation points MVP
    2023-02-17T21:57:16.58+00:00

    The best way may be to install a trusted certificate. Here is an article that I have found useful when I need to do this: https://codekabinett.com/rdumps.php?Lang=2&targetDoc=create-install-ssl-tls-certificate-sql-server

    0 comments No comments

  3. Kenneth Fromm 0 Reputation points
    2023-02-21T22:42:56.9333333+00:00

    Yes, any change I make in the web.config file for the connection it reverts back not long after. I am wondering if the user who is pushing any data towards the IIS instance on the server for the application is doing the change back.


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.