رفع مشکل خطای سرتیفیکیت در اتصال به SQL Server

mohsen5 ماه قبل4 ماه قبل
ارسال شده در
mohsen

در صورت بروز خطای زیر در زمان اتصال به SQL Server:

      Win32Exception: The certificate chain was issued by an authority that is not trusted.

SqlException: 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.)
    

می توانیم با اضافه کردن رشته زیر به کانکشن استرینگ مشکل را رفع کنیم:

      TrustServerCertificate=True
    

یا می توانیم انکریپشن را غیر فعال کنیم:

      Encrypt=false
    

کانکشن استرینگ به این صورت در می آید:

      User ID=*****;Password=*****;Initial Catalog=AdventureWorks;Server=MySqlServer;TrustServerCertificate=True;
    
رای
0
ارسال نظر
مرتب سازی:
اولین نفری باشید که نظر می دهید!