Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 SQL assembly accessing web service

Author  Topic 

Gobo5
Starting Member

1 Post

Posted - 2009-10-06 : 16:28:59
I apologize in advance if I'm using the wrong area.

Here is my current setup. I've got a stored procedure in a SQL Express instance that is using an assembly I've added to access a webservice hosted on another machine using IIS 5.1

The whole operation is used to query another database on the IIS machine and return a dataset to the stored procedure to be used in whatever way is needed.

Now, the problem is this. Originally the IIS machine had no encryption. EVERYTHING ran smoothly... Then we set IIS with a server side certificate to encrypt everything over SSL, a few minor changes and everything worked perfectly. Now, we have IIS requiring a client certificate. The assembly is returning an Access Forbidden error.

Here is the code from the assembly that is erroring out

'Required to accept the server certificate
ServicePointManager.ServerCertificateValidationCallback = AddressOf TrustAllCertificateCallback
Dim webService As New Service
'required to send the client certificate
webService.ClientCertificates.Add(New X509Certificate("C:\personal.pfx", "TestCertificatePass"))
Return webService.GetInfoFromDB(sDatabaseID, sQuery)


This block of code is used outside our SQL instance in other applications and they work fine with sending the client certificate, and the exact same certificate is used elsewhere also...

Is there something that needs to be changed for this to work within SQL? Am I overlooking something?
   

- Advertisement -