How to fix error with SQL server connection (trusted certificate)

Florentina 20 Reputation points
2023-11-28T19:32:17.0866667+00:00

Hello,

Today I tried to make a new connection to a new database, but it gives me an error.

I am using Visual Studio version 17.8.1.

1

If I however check the checkbox for Trust Server Certificate, the following error occurs when I try to make a chart element.

2

What should I do to fix the issue? I'm trying to make a project for uni, but this issue is something that happened after I updated to 17.8.1 from a previous version (I don't know which one). Mentioning also that I tried updating to 17.8.2 and then when nothing happened to fix the issue, I reverted back to 17.8.1, so now the revert to previous version feature doesn't appear for me anymore.

What should be done in this case? Can I find a previous, even older version of Visual Studio? Where should I find such version? Thank you so much for your help!

Developer technologies Visual Studio Other
SQL Server Other
0 comments No comments
{count} votes

Accepted answer
  1. Anonymous
    2023-11-29T03:21:16.86+00:00

    Hi @Florentina

    Here is the documentation on fixing certificate chain errors that you can use as a reference: "The certificate received from the remote server was issued by an untrusted certificate authority" error when you connect to SQL Server.

    Regarding the error "System.ArgumentException: 'Keyword not supported: 'trust server certificate''", removing the space between Trust Server Certificate may be effective. You can check out this thread: https://learn.microsoft.com/en-us/answers/questions/1195871/having-issue-with-keyword-not-supported-trust-serv.

    Maybe you can try unchecking the checkbox and see what the TrustServerCertificate property in Advanced Properties looks like.

    My VS version is 16.11.26, and its TrustServerCertificate attribute has no spaces.

    User's image

    For older versions of Visual Studio you can check this link: https://visualstudio.microsoft.com/vs/older-downloads/.

    If the answer is helpful, please click Accept Answer and Up-Vote for the same. If you have any questions, please feel free to let me know.

    Best regards,

    Aniya

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.