System.Data.SqlClient.SqlException: SSL Security error
Here's my config (development box):
Sql server 2000 Developer's Edition on windows XP pro
..net framework 1.1.4
mdac 2.71.9030.0
ssl configuration:
versign test certificate installed through IIS. The certificate has valid dates. I also imported the verisign root certificate (getcacert.cer) for testing into my "Trusted Root Certification Authories" store. This means when I go to IIS and hit a ssl p
age, I do not get a security warning since 1. the certificate name matches name in url 2. certificate has valid dates 3. the test CA is trusted since I imported the root cert into my trusted root store.
Senerios:
I go into my "client network utility" and "force protocol encryption". I use "Query Analyzer" to connect to one of my databases on the sql server that has the certificates installed. This connection is successful. I try to connect to another sql 2000
server running on another box that DOES NOT have certificates installed and the Query analyzer returns an error "Encryption not Supported". So at this point, I'm happy since it seems like the ssl connection to sql server is successful with Query Analyzer
. I try using Enterprise Manager now to connect to the ssl enabled sql server. Successful again! great! finally when I try to do it from my .NET Application, I get the dreaded "SSL Security Error". Here's the code for the .NET App:
Dim con As SqlConnection = New SqlConnection("SERVER=servername.domainname.com;DATABASE=dbname;U ID=username;PWD=pass;Encrypt=Yes")
con.Open() <--------------------------exception thrown here
If I remove "Encrypt=Yes" the connection is successful.
I tried using a Oledbconnection same results. I tried to use ODBC .net and an ODBCCOnnection. same error.
Then I tried to create a System DSN with "strong encryption for data". I tested the connection in the DSN Configurator....Click on "Test Data Source" button. Test Successful. BUt when I use this DSN from my .NET application I get the same error: "SSL S
ecurity Error".
I really would like to know if anyone has successfully used a ssl connection from a .net application?!!!??? It couldn't be the certificates! The certificates common name is fully qualified.....servername.domainname.com
The application runs on the same machine which the sql server runs, but I use the fully qualified servername in the connection string. (beside i did try to connect from a remote machine, after installed the root test certificates as trusted...still no lu
ck)
On the machine that the .net application is running, I've imported the root test certificate which was installed as the server. It is in as "Trusted Root Certification Authority". Query analyzer and Enterprise manager seem to work with the ssl encrypted
connection, so how could it be the certificates? Even on the webserver there's no security warning when I hit a https page (which means the certificates installed are trusted and valid). My tests were mainly done with the sql server and the .net server
on the same machine however I did try remote machines too with no luck. This machine has only 1 network card and 1 website in IIS. There's only 1 ssl certificate installed on this machine. Anyone have similar problems?????
THanks!