简体   繁体   English

该请求已中止:无法创建SSL / TLS安全通道.Net 4.5.2

[英]The request was aborted: Could not create SSL/TLS secure channel .Net 4.5.2

Please someone help me, when I invoke 3rd party webservice, it shows : 当我调用第三方网络服务时,请有人帮助我,它显示:

Initializing
Generating WSDL
System.InvalidOperationException: General Error https://xxx ---> System.Net.WebException: There was an error downloading 'https:/xxx'. ---> System.Net.WebException: The request was aborted: Could not create SSL/TLS secure channel.
   at System.Web.Services.Protocols.WebClientProtocol.GetWebResponse(WebRequest request)
   at System.Web.Services.Protocols.HttpWebClientProtocol.GetWebResponse(WebRequest request)
   at System.Web.Services.Discovery.DiscoveryClientProtocol.Download(String& url, String& contentType)
   --- End of inner exception stack trace ---
   at System.Web.Services.Discovery.DiscoveryClientProtocol.Download(String& url, String& contentType)
   at System.Web.Services.Discovery.DiscoveryClientProtocol.DiscoverAny(String url)
   at WebServiceStudio.Wsdl.ProcessRemoteUrls(DiscoveryClientProtocol client, StringCollection urls, XmlSchemas schemas, ServiceDescriptionCollection descriptions)
   --- End of inner exception stack trace ---
   at WebServiceStudio.Wsdl.ProcessRemoteUrls(DiscoveryClientProtocol client, StringCollection urls, XmlSchemas schemas, ServiceDescriptionCollection descriptions)
   at WebServiceStudio.Wsdl.Generate()

I Already try using X509 Certificate, give user everyone full permission. 我已经尝试使用X509证书,给用户所有人完全许可。

This may occur when the SSL certificate of the web service is not valid. 当Web服务的SSL证书无效时,可能会发生这种情况。

For a workaround, try the following code: 要解决此问题,请尝试以下代码:

System.Net.ServicePointManager.ServerCertificateValidationCallback += new System.Net.Security.RemoteCertificateValidationCallback(delegate
{
    return true;
});

If this fixes your issue, then you should check the certificate on your machine. 如果这解决了您的问题,则应检查计算机上的证书。

As @dman2306 says, this is merely to check whether the certificate is the cause of your issues. 正如@ dman2306所说,这仅是为了检查证书是否是造成您问题的原因。 Do not use this in any production code. 请勿在任何生产代码中使用此代码。

暂无
暂无

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

相关问题 .NET请求已中止:无法创建SSL / TLS安全通道 - .NET The request was aborted: Could not create SSL/TLS secure channel 带有 TLS/SNI 的 Azure 上的 .net httpclient:请求被中止:无法创建 SSL/TLS 安全通道 - .net httpclient on Azure w/ TLS/SNI: The request was aborted: Could not create SSL/TLS secure channel 请求已中止:无法创建SSL / TLS安全通道 - SecurityProtocol行为 - The request was aborted: Could not create SSL/TLS secure channel - SecurityProtocol behavior WebException:请求已中止:无法创建SSL / TLS安全通道 - WebException: The request was aborted: Could not create SSL/TLS secure channel 请求已中止:无法创建SSL / TLS安全通道异常 - The request was aborted: Could not create SSL/TLS secure channel Exception HttpWebRequest:请求已中止:无法创建SSL / TLS安全通道 - HttpWebRequest: The request was aborted: Could not create SSL/TLS secure channel 请求被中止:无法创建 SSL/TLS 安全通道 - The request was aborted: Could not create SSL/TLS secure channel HttpClientHandler / 请求被中止:无法创建 SSL/TLS 安全通道 - HttpClientHandler / The request was aborted: Could not create SSL/TLS secure channel 服务器错误:请求已中止:无法创建SSL / TLS安全通道 - Server Error: The request was aborted: Could not create SSL/TLS secure channel RestSharp 请求中止 - 无法创建 SSL/TLS 安全通道 - RestSharp request aborted - could not create SSL/TLS secure channel
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM