C# XmlDocument.Load:无法创建SSL/TLS安全通道

C# XmlDocument.Load:无法创建SSL/TLS安全通道,c#,.net,ssl,httpwebrequest,xmldocument,C#,.net,Ssl,Httpwebrequest,Xmldocument,我在我的应用程序中有类似的简单代码: new XmlDocument().Load("https://mybookingpal.com/xml/rest/product/organization/5?pos=" + "a3a2e74b809e0e87"); 以上为新域,旧域为: new XmlDocument().Load("https://razor-cloud.com/xml/rest/product/organization/5?pos=" + "a3a2e74b809e0e87");

我在我的应用程序中有类似的简单代码:

new XmlDocument().Load("https://mybookingpal.com/xml/rest/product/organization/5?pos=" + "a3a2e74b809e0e87");
以上为新域,旧域为:

new XmlDocument().Load("https://razor-cloud.com/xml/rest/product/organization/5?pos=" + "a3a2e74b809e0e87");
您可以尝试这两个URL,并看到它们工作正常/产生相同的XML结果

SSL中可能发生了一些变化,现在阻止了.Load()的运行。我有两个问题:

  • 是什么导致了故障,所以我可以尝试在一个地方(API服务器上)修复它
  • 如何修复客户端代码

  • 我也有同样的问题。事实证明,这是由

    
    
    检查xml文件头

    
    
    复制url并粘贴到浏览器中,然后运行Fiddler以查看正在使用的协议

    我的情况是,我正在运行一个本地服务器来解析一个使用第三方DTD的xml文件。我的本地服务器在Tls11或Tls12上运行,而第三方DTD(url)只能通过Ssl或Tls10进行通信。因此它无法握手

    我的解决方案很简单,只需添加以下行作为临时修复:

    ServicePointManager.SecurityProtocol=SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls;
    
    这看起来与我遇到的问题相同,与此链接相同:


    使用表单身份验证和Https登录后,我希望不需要其他身份验证。但是,new XmlDocument().Load()会再次加载登录页面。由于此页面是html,因此会引发错误xml格式的异常

    您假定SSL中发生了一些变化,但没有真正告诉我们原因。调用XmlDocument.Load()时会发生什么?你看到错误了吗?@sevzas错误信息在帖子的标题中。我相信这是因为SSLv3未启用(仍有待确认)。对我来说,这完全是同一个问题的复制品。然而,解决办法没有奏效。