locked
TrustServerCertificate=false RRS feed

  • Question

  • User134484314 posted

    Hi Expert,

    I set  TrustServerCertificate=false; Encrypt=True" in webconfig and using sql server TLS certificate getting error message

    Server Error in '/' Application.


    The target principal name is incorrect

    Connection string

    <add name="SQLConnectionString" providerName="System.Data.SqlClient" connectionString="Server=xxx;Database=xxx;User ID=xxxx;Password=xxx1;MultipleActiveResultSets=True;Use Encryption for Data=True; TrustServerCertificate=false; Encrypt=True" />

    Wednesday, May 20, 2020 1:55 AM

All replies

  • User-257212555 posted

    Hi Shree,

    If you want to verify the certificate before encryption, the value you set for TrustServerCertificate and Encrypt is Correct. The issue arises due to some other conflicts.

    kindly go through this Link . Hope this will fix the Issue.

    Thanks & Regards,

    Menaka Baskar

    Wednesday, May 20, 2020 5:26 AM
  • User-474980206 posted

    Check that the server name in the connect string matches the server name on Sqlserver ssl certificate.

    Wednesday, May 20, 2020 2:41 PM