我试图为SharePoint 2010 Web服务编写代理,以便为我们在Ruby中编写的另一组服务绕过NTLM身份验证 . 我开发了它,当我在visual studio中的asp.net服务器上调试它时,我能够很好地获取和解析数据 . 但是,当我将它部署到我们的IIS服务器时,我收到以下错误:

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

我正在使用SharePoint 2010客户端对象模型来连接到我具有完全控制访问权限的自签名Sharepoint站点 . 再次,当我调试它时,这完全正常,但在IIS上它会抛出以下Stacktrace的错误:

at System.Net.HttpWebRequest.GetResponse() at
Microsoft.SharePoint.Client.SPWebRequestExecutor.Execute() at
Microsoft.SharePoint.Client.ClientContext.EnsureFormDigest() at
Microsoft.SharePoint.Client.ClientContext.ExecuteQuery() at
SharepointProxy.SharepointProxy.GetListData(String listName) in
\\psf\home\documents\visual studio
2010\Projects\SharepointWSProxy\SharepointProxy\SharepointProxy.svc.cs:line 56 at
SharepointProxy.SharepointProxy.GetEmployees() in \\psf\home\documents\visual studio
2010\Projects\SharepointWSProxy\SharepointProxy\SharepointProxy.svc.cs:line 19 at
SyncInvokeGetEmployees(Object , Object[] , Object[] ) at
System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[]
inputs, Object[]& outputs) at
System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc) at
System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc&
rpc) at
System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc&
rpc) at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean
isOperationContextSet)

这是相关的代码 . 也许我做错了什么?

ClientContext context = new ClientContext("https://url.to.subsite");
List destList = context.Web.Lists.GetByTitle(listName);
CamlQuery qry = new CamlQuery();
qry.ViewXml = "<Valid Query>";
ListItemCollection items = destList.GetItems(qry);
context.Load(items);
context.Load(destList);
context.ExecuteQuery();

上面的第56行是它引用items变量的地方 . 它就在这之下 .

有人有主意吗?我完全不知道为什么它在调试中工作但在IIS上没有 .