I\'m using Encrypt=yes
in a SQL Server connection string, as I need the TCPIP traffic to be encrypted, but on opening the connection I get an error:
<
I realize this is pretty old, but thought this might still help someone.
If the server you are connecting to does not have a certificate installed, a default certificate number is generated each time the server is restarted. When this happens the CN number changes, and might not match the one you have.
I read this recently, but I'm still trying to find the link for you. I'd suggest you makes sure that the server you are connecting to has explicitly installed a certificate, and that your client has it too.
I'll update this as soon as I find the link.
Your database connection can be configured to encrypt traffic and to accept any certificate from your server. Not a grand solution, but it worked for me.
The resulting connection string should look like this:
"[...];Encrypt=True;TrustServerCertificate=True"