I was trying to Update-Database after doing a migration of my project. Then this error appeared:
A connection was successfully established with the server, but then an error occurred during the login process. (provider: SSL Provider, error: 0 - The certification chain was issued by an untrusted entity.)
I finally resolved it by adding TrustServerCertificate=True in my connection string. Then I researched a bit and found out that this solution is unsecure since it can lead to man in the middle attacks. My question is, how can I solve this error so that it can be applied to all production environments?