-1

I am invoking a web Service call inside SQL Clr table valued function (C#). When the sql function is invoked following error is received

"The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel."

The web service url used is https and for SSL 3 i have explicitly used following directive in the C# code "ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3;"

When the exact same C# codde is used in console application and invoked it works fine but from the SQL server its failing any help is greatly appreciated.

paranjai
  • 521
  • 2
  • 5
  • 25
  • are you perhaps closing or disposing of the connection ? perhaps it's a timeout issue.. post your code example that calls the webservice...thx – MethodMan Dec 13 '11 at 21:09
  • Declared as UNSAFE etc to allow it to do stuff that really shouldn't be done in SQL Server? – gbn Dec 13 '11 at 21:14
  • I fixed the issue , For sql server the certificate should be imported to Local machine certificate store , I did for the User store and this was stopping the underlying connection. – paranjai Dec 13 '11 at 21:53

1 Answers1

2

Issue is fixed now, For sql server clr web service code to use the certificate should be imported to Local machine certificate store , I did for the User store and this was stopping the underlying connection.

paranjai
  • 521
  • 2
  • 5
  • 25