0

I have multiple API projects and I can them successfully. But the WorkerService API project throws the following warning:

Microsoft.Data.SqlClient.SqlException (0x80131904): 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.)

My connection string:

"data source=server ;initial catalog=ECOMDB;persist security info=True;user id=****;password=****;MultipleActiveResultSets=True;App=EntityFramework;"

I have seen this post, but it did not solve my issue: "The certificate chain was issued by an authority that is not trusted" when connecting DB in VM Role from Azure website

Adriaan
  • 17,741
  • 7
  • 42
  • 75
firatt_
  • 136
  • 2
  • 10
  • 1
    You have `Encrypt=false;TrustServerCertificate=True;` in the presented connection string so shouldn't be getting that error from this. Do you have other connection strings in your appsettings.json file, or hard-coded connection details in your .NET code (especially in Entity Framework migrations)? – AlwaysLearning Dec 01 '22 at 10:01
  • Yes we got this now :) this is the issue . I had double checked many app.config files :) but I notice now there is a additional appsetting.json file this is the missing part thanks a lot your for help – firatt_ Dec 01 '22 at 10:23
  • Please don't add "solved" to your question title or body. See [what should I do when someone answers](https://stackoverflow.com/help/someone-answers) on how to show you've solved your problem. If you've found your own answer, great! [Answering your own question is allowed and even encouraged](https://stackoverflow.com/help/self-answer). – Adriaan Apr 05 '23 at 05:46

1 Answers1

0
       "data source=server ;initial catalog=ECOMDB;persist security info=True;user id=****;password=****;MultipleActiveResultSets=True;
    App=EntityFramework;Encrypt=false;TrustServerCertificate=True;"

Encrypt=false;TrustServerCertificate=True; Added

firatt_
  • 136
  • 2
  • 10