简体   繁体   English

无法为SOAP调用建立SSL / TLS的安全通道

[英]Could not establish secure channel for SSL/TLS for SOAP call

Our core server is calling out to a soap web service over https on a number of different servers to confirm that a transaction has completed. 我们的核心服务器通过https在多个不同的服务器上调用soap Web服务,以确认事务已完成。

The code is dotnet 3.5 (vb) and works for the various callback services we have set up until we just moved a new one into production and it is refusing to communicate, giving the following error: 代码是dotnet 3.5(vb),适用于我们设置的各种回调服务,直到我们将新的服务转移到生产环境中并拒绝通信,给出以下错误:

Unhandled Exception: System.ServiceModel.Security.SecurityNegotiationException:
Could not establish secure channel for SSL/TLS with authority 'www.xyzzy.com'.
---> System.Net.WebException: The request was aborted: Could not create SSL/TLS secure channel.
at System.Net.HttpWebRequest.GetResponse()
at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)

The relevant piece of code would seem to be: 相关的代码片段似乎是:

Dim epAddr As New System.ServiceModel.EndpointAddress(sys.CallbackAddress)
Dim bind As New System.ServiceModel.BasicHttpBinding(ServiceModel.BasicHttpSecurityMode.Transport)

_svc = New CallbackSvc.XyzzyCallbackSoapClient(bind, epAddr)

From my personal laptop (WinXP), I can run the code and it connects to the new server without issues. 从我的个人笔记本电脑(WinXP),我可以运行代码,它连接到新服务器没有问题。

From the main server (which calls all the callback services) (Windows Server Enterprise Service Pack 1), the code always results in the aforementioned SSL error. 从主服务器(调用所有回调服务)(Windows Server Enterprise Service Pack 1),代码始终导致上述SSL错误。

After googling the issue I tried adding the following line (certainly not suitable for production but I wanted to test): 谷歌搜索后,我尝试添加以下行(当然不适合生产,但我想测试):

System.Net.ServicePointManager.ServerCertificateValidationCallback = Function(se As Object, cert As System.Security.Cryptography.X509Certificates.X509Certificate, chain As System.Security.Cryptography.X509Certificates.X509Chain, sslerror As System.Net.Security.SslPolicyErrors) True

The result was the same. 结果是一样的。 The SSL error still occurred. SSL错误仍然发生。

Other places suggest the root cert has not be installed correctly on the calling machine but both the new server and old callback servers use certs issued by Go Daddy so I don't think this is the case here. 其他地方建议根证书没有在呼叫机器上正确安装,但新服务器和旧回调服务器都使用Go Daddy颁发的证书,所以我不认为这是这种情况。

This turned out to be an interaction between the production "core" server (the one calling the service) and the destination server (hosting the service) not sharing an acceptable https algorithm. 结果是生产“核心”服务器(调用服务的服务器)和目标服务器(托管服务)之间的交互不共享可接受的https算法。 wfetch was extremely helpful in diagnosing the issue. wfetch在诊断问题时非常有帮助。

It turned out the destination server was not set up to accept TLS 1.0, only SSL 3.0 was accepted. 事实证明,目标服务器未设置为接受TLS 1.0,仅接受SSL 3.0。

Apparently, something changed in Windows 2008 Server which means that outbound https connections would only be acceptable using TLS 1.0 (or better, presumably). 显然,在Windows 2008 Server中发生了一些变化,这意味着出站https连接只能使用TLS 1.0(或者更好,可能是)来接受。

In our case, the problem was resolved when the configuration on the destination server was changed to accept TLS. 在我们的示例中,当目标服务器上的配置更改为接受TLS时,问题已得到解决。 It feels like there should be a way to alter my program to force it to use SSL but I haven't found it. 感觉应该有一种方法来改变我的程序以强制它使用SSL,但我还没有找到它。

On the client side, try: 在客户端,尝试:

ServicePointManager.Expect100Continue = true;
ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3;

I got the same error "Could not establish secure channel for SSL/TLS with authority 'www.xyzzy.com'." 我得到了同样的错误“无法为权限'www.xyzzy.com'建立SSL / TLS的安全通道。” when moving an existing application including a required client certificate from one server to another. 将包含所需客户端证书的现有应用程序从一个服务器移动到另一个服 What caused the problem on the new server was that the IIS-user, in this case "IIS_WPG", didn't have have read & execute permission for the certificate just moved to the new server. 导致新服务器出现问题的原因是IIS用户(在本例中为“IIS_WPG”)对刚刚移动到新服务器的证书没有读取和执行权限。 Changing the certificate access permissions can be done with wsetools. 可以使用wsetools更改证书访问权限。 /Stefan /斯特凡

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法为 SSL/TLS 安全通道建立信任关系 -- SOAP - Could not establish trust relationship for SSL/TLS secure channel -- SOAP 无法为具有权限“*”的 SSL/TLS 建立安全通道 - Could not establish secure channel for SSL/TLS with authority '*' .NET 4.6.2 中 SOAP 的“无法为具有授权的 SSL/TLS 安全通道建立信任关系” - “Could not establish trust relationship for the SSL/TLS secure channel with authority” for SOAP in .NET 4.6.2 WCF错误“无法为SSL / TLS建立安全通道……” - WCF Error “Could not establish secure channel for SSL/TLS …” out of the blue 随机“无法为SSL / TLS建立安全通道”错误 - Random “could not establish secure channel for SSL/TLS” errors 随机抛出“无法建立SSL / TLS安全通道的信任关系” - Randomly throwing “Could not establish trust relationship for the SSL/TLS secure channel” 通信后无法使用授权建立SSL / TLS的安全通道 - Could not establish secure channel for SSL/TLS with authority after communication 具有有效证书的“无法为SSL / TLS安全通道建立信任关系” - “Could not establish trust relationship for the SSL/TLS secure channel” with valid certificate 客户端证书:无法为具有权限的SSL / TLS建立安全通道(再次!) - Client certificate: Could not establish secure channel for SSL/TLS with authority (Again!) WCF 客户端 - 无法为 SSL/TLS 建立安全通道 - WCF client - Could not establish secure channel for SSL/TLS
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM