简体   繁体   中英

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.

This may occur when the SSL certificate of the web service is not valid.

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. Do not use this in any production code.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM