本文介绍了调用的.NET Web服务时绕道无效的SSL证书错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

我们正在建立一个新的SharePoint对此我们没有一个有效的SSL证书呢。我想调用列表Web服务上检索有关设置一些元数据。然而,当我尝试这样做,我得到的异常:

We are setting up a new SharePoint for which we don't have a valid SSL certificate yet. I would like to call the Lists web service on it to retrieve some meta data about the setup. However, when I try to do this, I get the exception:

基础连接已关闭:无法建立在SSL信任关系/ TLS安全通道

嵌套异常包含错误信息:

The nested exception contains the error message:

远程证书根据验证过程是无效的。

这是正确的,因为我们使用的是临时证书。

This is correct since we are using a temporary certificate.

我的问题是:我怎么能告诉.NET Web服务客户端( SoapHttpClientProtocol 的)忽略这些错误?

My question is: how can I tell the .Net web service client (SoapHttpClientProtocol) to ignore these errors?

推荐答案

我曾经当面对这个问题是临时证书的签名者添加到信任当局的做法有问题的计算机上列出。

The approach I used when faced with this problem was to add the signer of the temporary certificate to the trusted authorities list on the computer in question.

我通常做测试与CACERT创建的证书,并将其添加到我的受信任的机构名单奋力顺顺当当。

I normally do testing with certificates created with CACERT, and adding them to my trusted authorities list worked swimmingly.

这样做,这样意味着你不必添加任何自定义code到你的应用程序,它正确地模拟了当你的应用程序部署会发生什么。因此,我认为这是一个优秀的解决方案以编程方式关闭检查。

Doing it this way means you don't have to add any custom code to your application and it properly simulates what will happen when your application is deployed. As such, I think this is a superior solution to turning off the check programmatically.

这篇关于调用的.NET Web服务时绕道无效的SSL证书错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-07 00:44