You receive the following error when attempting to establish a secure SSL connection using a connection string to an SQL Database Server: "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."
Since we use a self-signed certificate please disable SSL verification, you need to modify your connection string by adding TrustServerCertificate=True
. This parameter instructs your connection to trust the server's SSL certificate.
For example:
Server=myServerAddress;Database=myDataBase;User Id=myUsername;Password=myPassword;Encrypt=True;TrustServerCertificate=True;