Keyword not supported: 'trust server certificate'.
chuck
Posts: 29 Bronze 2
Working on version 4.2.20168, and encounter error Keyword not supported: 'trust server certificate'.
remove Trust Server Certificate=True, then got error Invalid connection string: Keyword not supported: 'multi subnet failover'.
remove Multi Subnet Failover=False, then got Error connecting to database: 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.)
According https://stackoverflow.com/questions/17615260/the-certificate-chain-was-issued-by-an-authority-that-is-not-trusted-when-conn, I add Trust Server Certificate=True to the end of ShadowConnectionString section and make it work.
<ShadowConnectionString>Data Source=ip;Initial Catalog=Chuck2_Connect5;User ID=clu;Password=;Pooling=False;Encrypt=False;Trust Server Certificate=True;Authentication=SqlPassword;Multi Subnet Failover=False</ShadowConnectionString>
changed to
<ShadowConnectionString>Data Source=ip;Initial Catalog=Chuck2_Connect5;User ID=clu;Password=;Pooling=False;Encrypt=False;Authentication=SqlPassword;TrustServerCertificate=True</ShadowConnectionString>Best Answers
-
chuck Posts: 29 Bronze 2Just in case someone else encounter the same problemTrust Server Certificate=True changed to TrustServerCertificate=TrueMulti Subnet Failover=False changed to MultiSubnetFailover=FalseRemove the space in key will solve the problem
-
chuck Posts: 29 Bronze 2The problem was introduced in 4.2.20176 - June 24th, 2020.I previously use 4.2.20168 open the old project created by 4.2.20176.
Answers
In version 4.2.20168, encountering errors related to the connection string parameters 'Trust Server Certificate' and 'Multi Subnet Failover' prompted troubleshooting steps. Initially, removing 'Trust Server Certificate=True' led to an error regarding 'Multi Subnet Failover'. Subsequently, eliminating 'Multi Subnet Failover=False' resulted in a new error concerning the SSL certificate chain. Following guidance from Stack Overflow, the resolution involved appending 'Trust Server Certificate=True' to the end of the ShadowConnectionString section. This adjustment ensured successful database connectivity, emphasizing the importance of meticulous configuration in resolving connection issues.
To address the issues you're encountering with your connection string, let's break down the steps and provide a comprehensive solution.
Problem Breakdown
Initial Error:
Trust Server Certificate=True
Second Error:
Multi Subnet Failover=False
Third Error:
Solution:
Trust Server Certificate=True
which made the connection work.Solution Explanation
1. Correcting the Keywords
Based on the errors, the keywords used in your connection string need to be properly formatted. Specifically:
TrustServerCertificate
instead ofTrust Server Certificate
.Multi Subnet Failover
if it's not supported.2. Updated Connection String
The correct format should be:
Steps to Resolve the Issue
Correct the Connection String Syntax:
TrustServerCertificate
.Multi Subnet Failover
if it's not supported or necessary.Trusting the Server Certificate:
TrustServerCertificate=True
instructs the SQL client to trust the server's certificate without validating it against a trusted certificate authority. This is useful in development or testing environments but should be used with caution in production.Using Proper Authentication:
User ID
andPassword
are correct.Authentication=SqlPassword
setting is used for SQL Server authentication.Complete Corrected Connection String
Here is the corrected connection string based on the provided information:
Additional Considerations
TrustServerCertificate=True
bypasses the validation of the server's SSL certificate. This can expose your connection to security risks, such as man-in-the-middle attacks. For production environments, it is recommended to use a trusted certificate issued by a recognized certificate authority.Summary
TrustServerCertificate
).Multi Subnet Failover
).If you follow these steps, your connection string should work correctly without the errors you encountered. If you need further assistance, feel free to ask!
First Problem: You saw an error saying "Keyword not supported: 'trust server certificate'". To fix this, you removed
Trust Server Certificate=True
from your connection details.Second Problem: Then you got another error saying "Keyword not supported: 'multi subnet failover'". To fix this, you removed
Multi Subnet Failover=False
from your connection details.Third Problem: After that, you faced another error saying "Error connecting to database.. The certificate chain was issued by an authority that is not trusted." This means the system didn't trust the security certificate.
Final Solution: You followed advice from a website and added
Trust Server Certificate=True
again at the end of your connection details. Now it worked!So, here is what your connection details should look like:
This way, you should be able to connect without any problems. If you still facing any issue, then do let me know i'll try to figure out!
You resolved the connection string issues by adding
TrustServerCertificate=True
to bypass SSL certificate validation. Removing unnecessary options likeMulti Subnet Failover=False
helped stabilize the connection. The final connection string should look like this:<ShadowConnectionString>Data Source=ip;Initial Catalog=Chuck2_Connect5;User ID=clu;Password=;Pooling=False;Encrypt=False;Authentication=SqlPassword;TrustServerCertificate=True</ShadowConnectionString>
This ensures a successful connection despite the certificate trust issue.
It seems you're facing issues with connection string parameters that are not supported by the version you're using. To resolve this:
Remove Unsupported Keywords: Start by removing the unsupported keywords,
Trust Server Certificate=True
andMulti Subnet Failover=False
.SSL Certificate Error: When you remove
Trust Server Certificate=True
, it results in an SSL certificate error. This suggests that your server's SSL certificate is not trusted.Final Solution: Ensure your connection string in
<ShadowConnectionString>
hasTrustServerCertificate=True
, without spaces, and does not include unsupported keywords:This should resolve your connection issues.
Trust Server Certificate
andMulti Subnet Failover
. You resolved the SSL trust error by modifying the connection string to includeTrustServerCertificate=True
without spaces and removing the unsupported parameters. This allowed the connection to succeed despite the SSL certificate not being trusted. For others facing this issue, ensuring correct parameter syntax and addressing SSL trust by settingTrustServerCertificate=True
should help resolve similar errors.