i'm facing issue
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.)
i'm facing issue
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.)
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Rajeesh MenothRank #118 · 18.4K reputationPosted Feb 1, 2023, 11:43 AM EST
Hi,
In Asp.Net Core connection string you can add "Trust Server Certificate=true;".
"ConnectionStrings": { "SqlServerConnection": "Server=.; Database=MyDb; User ID=MyUser; Password=MyPwd; Trust Server Certificate=true;" }Please check the following reference :
https://stackoverflow.com/questions/17615260/the-certificate-chain-was-issued-by-an-authority-that-is-not-trusted-when-conn/17658821#17658821
Sachin SinghRank #66 · 26.2K reputationPosted Feb 1, 2023, 12:02 PM EST
Modify your connection string as
"Server=YourServerAddress; Database=YourDBName; User Id=YourDBUserID; Password=YourDBPassword; TrustServerCertificate=True"Muhammad Imran AnsariRank #326 · 7.6K reputationPosted Feb 1, 2023, 10:54 AM EST
Hi Tahir,
This error occurs when the server's SSL certificate is not trusted by the client.
For testing purposes, disable SSL validation in your ASP.NET Core application temporarily but not recommended for production environments as it introduces security risks.
Naimish MakwanaRank #324 · 7.7K reputationPosted Feb 1, 2023, 11:22 PM EST
Hello Tahir,
This error message is indicating that the SSL certificate used by the server you're trying to connect to is not trusted by the client you're using to connect.
Use below connection string and check.
Thanks
Naimish
Jignesh KumarRank #91 · 22.9K reputationPosted Feb 1, 2023, 11:32 PM EST
Hello Tahir,
Just add TrustServerCertificate=Yes; end of your connection string in appSettings.json file
"ConnectionStrings": { "SqlServerConnection": "Server=.; Database=YourDatabaseName; User ID=YourUserName; Password=YourPassword; TrustServerCertificate = true;" }Anupam MaitiRank #295 · 8.5K reputationPosted Feb 2, 2023, 1:06 AM EST
This is happening due to the SSL certificate presented by the server is not trusted by the client. Modify your db connection string as
"Server=YourServerAddress; Database=YourDBName; User Id=YourDBUserID; Password=YourDBPassword; TrustServerCertificate=True"
Rajeev KumarRank #1,334 · 1.3K reputationPosted Mar 2, 2023, 6:49 AM EST
Hi Tahir plz updated your Connection String as below-
"ConnectionStrings": { "SqlServerConnection": "Server=.; Database=MyDb; User ID=MyUser; Password=MyPwd; Trust Server Certificate=true;" }
Rijwan AnsariRank #82 · 24.2K reputationPosted Mar 2, 2023, 7:23 AM EST
I faced the same issue in my previous solution.
https://rijsat.com/2022/12/12/entity-framework-update-database-error-the-certificate-chain-was-issued-by-an-authority-that-is-not-trusted/
The default value of the Encrypt connection setting has been changed from false to true. With the growing use of cloud databases and the need to ensure those connections are secure, it’s time for this backwards-compatibility-breaking change.
We need to add additional parameters trusted_connection=true;encrypt=false; in the connection string.
"ConnectionStrings": { "AppDatabase": "Data Source=rijwan7475001;Initial Catalog=mydotnet7;Integrated Security=True;trusted_connection=true;encrypt=false;" }Anandu G NathRank #681 · 3.5K reputationPosted Dec 20, 2023, 12:22 AM EST
Try to modify your Existing Connection string
"Server=IT\SQLEXPRESS; Database=TESTDB; User Id=sa; Password=sa@123; TrustServerCertificate=True"