Working on a proof of concept to see if it is possible and running into an issue.
Backgroud
I have a simple web service (.asmx type) that returns a small subset of data. The web service resides on a seperate web server that is SSL enabled and has require client certificates set. I am trying to call this web service via a custom visual web part in SharePoint (which is also SSL enabled). I have added the certificate chain of the SSL certificate from the web server that hosts the web service into the SharePoint certificate store (in Central Admin). I am adding a client certificate to the webservice call via the following statement.
XmlNode myNode = null
X509Certificate2 cert = new x509Certificate2(CertPath, CertPass)
if (cert != null)
{
WebServiceTest.Service myService = new WebServiceTest.Service ();
myService.Url = "https://serverFQDN/webservicetest/service.asmx";
myService.ClientCertificates.Add(cert);
myNode = myService.DataTest();
return myNode
}The above code is in a try catch that returns the error message and stacktrace back to the screen.
I can use this same code and call the web service from a standard ASP.Net web application hosted on a web server or my local machine or a console application with no issues, however as soon as I try it from a SharePoint web
part I get the message "The Request was Aborted. Could not create SSL/TLS secure channel". I have tried with the client certificate stored on the file system in a location accessible by SharePoint service accounts and as an embedded
resource in the dll.
Any input is appreciated.
Jeremy