B"H
this morning, I tried accessing some Ms Access reports that have worked just fine in the past, and all of a sudden the gave the error "The certificate's CN name does not match the passed value."
When I checked my c# clients and saw that they were all working fine I remembered seeing this post on MSDN forums. which told me to add "TrustServerCertificate=true" to my ADO.net connection string. I had done that back then, and that was what was making my c# clients work, so I needed a way to add that to my ODBC parameters.
Thank G-D, I recently switched the way that I have my clients specify ODBC parameters on their personal computers.
I destribute a *.reg file which creates a User DSN on their computer.
Then all of my ODBC connections refer to that DSN, knowing that it will definitely exest on their computer or I can just instruct them to run the *.reg file.
So this morning all I had to do was figure out the correct syntaxt for "TrustServerCertificate=true" in ODBC and redistribute the *.reg file and instruct all of my clients to rerun the file.
the file now looks like this:
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\NameOfDSN]
"Driver"="c:\\Windows\\system32\\sqlncli10.dll"
"Server"="NameOfMyServer.database.windows.net"
"Database"="NameOfDatabase"
"Encrypt"="Yes"
"TrustServerCertificate"="Yes"
"LastUser"="username@NameOfMyServer"
"Trusted_Connection"="No"
"AutoTranslate"="No"
[HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\ODBC Data Sources]
"NameOfDSN"="SQL Server Native Client 10.0"
replacing NameOfDSN with the actual name of the DSN and NameOfMyServer with the actual name of the server
I hope this helps someone.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment