{"id":860,"date":"2022-04-22T06:48:13","date_gmt":"2022-04-22T06:48:13","guid":{"rendered":"https:\/\/bruceng.com\/dev\/?p=860"},"modified":"2022-04-22T06:48:13","modified_gmt":"2022-04-22T06:48:13","slug":"cannot-connect-to-mssql-database-from-net-6-application","status":"publish","type":"post","link":"https:\/\/bruceng.com\/dev\/?p=860","title":{"rendered":"Cannot connect to MSSQL database from .NET 6 application"},"content":{"rendered":"\n<p>If you encounter SSL error when a .NET 6 application tries to connect to the MSSQL database<\/p>\n\n\n\n<p> Microsoft.Data.SqlClient.SqlException : A connection was successfully established with the server, but then an error occurred during the login process. (provider: SSL Provider, error: 0 &#8211; The certificate chain was issued by an authority that is not trusted.)<br> System.ComponentModel.Win32Exception : The certificate chain was issued by an authority that is not trusted.<\/p>\n\n\n\n<p>Not sure why, it might be that the new libraries are more strict regarding security. A workaround is to add TrustServerCertificate=True to the connection string.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you encounter SSL error when a .NET 6 application tries to connect to the MSSQL database Microsoft.Data.SqlClient.SqlException : A connection was successfully established with the server, but then an error occurred during the login process. (provider: SSL Provider, error: 0 &#8211; The certificate chain was issued by an authority that is not trusted.) System.ComponentModel.Win32Exception &hellip; <a href=\"https:\/\/bruceng.com\/dev\/?p=860\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Cannot connect to MSSQL database from .NET 6 application&#8221;<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[51,10],"class_list":["post-860","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-net","tag-sql-server"],"_links":{"self":[{"href":"https:\/\/bruceng.com\/dev\/index.php?rest_route=\/wp\/v2\/posts\/860","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bruceng.com\/dev\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bruceng.com\/dev\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bruceng.com\/dev\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/bruceng.com\/dev\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=860"}],"version-history":[{"count":1,"href":"https:\/\/bruceng.com\/dev\/index.php?rest_route=\/wp\/v2\/posts\/860\/revisions"}],"predecessor-version":[{"id":861,"href":"https:\/\/bruceng.com\/dev\/index.php?rest_route=\/wp\/v2\/posts\/860\/revisions\/861"}],"wp:attachment":[{"href":"https:\/\/bruceng.com\/dev\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=860"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bruceng.com\/dev\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=860"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bruceng.com\/dev\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=860"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}