2

I have simple code similar to this strewn through my application:

new XmlDocument().Load("https://mybookingpal.com/xml/rest/product/organization/5?pos=" + "a3a2e74b809e0e87");

The above is the new domain, the old domain is:

new XmlDocument().Load("https://razor-cloud.com/xml/rest/product/organization/5?pos=" + "a3a2e74b809e0e87");

You can try both Urls and see they work fine / produce the same XML results.

Something has presumably changed in the SSL which is now preventing the .Load() from functioning. I have two questions:

  1. What is causing the failure, so I can try get it fixed in one place (on the API server)?
  2. How do I fix the client code?
Sean
  • 14,359
  • 13
  • 74
  • 124
  • You presume something has changed in the SSL, but you don't really tell us why. What happens when XmlDocument.Load() is called? Do you see an error? – sevzas Oct 30 '14 at 12:44
  • @sevzas the error message is in the title of the post. I believe it's because SSLv3 is not enabled (still to be confirmed). – Sean Oct 30 '14 at 13:56

2 Answers2

2

I had the same issue. And turns out it's caused by the xml DTD defined in the

<!DOCTYPE>

Check the xml file header

<!DOCTYPE xxx SYSTEM "url">

Copy the url and paste in browser and run the Fiddler to see what protocol it's being used.

My case was that, I'm running a local server to parse a xml file that's using a DTD from a 3rd party. My local server is running on Tls11 or Tls12, while the 3rd party DTD (the url) can only be communicated via Ssl or Tls10. So it fails to handshake.

My solution is simply, by just adding the below line as a temporary fix:

ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls;
JC N
  • 21
  • 2
0

This looks like the same problem as I am having, which is same as this link: Form Authentication and XmlDocument.Load

Having logged in using forms authentication and using Https, I expect not other authentication to be necessary. However, new XmlDocument().Load() loads the login page again. Since this page is html, it throws an exception of incorrect xml format.

Ignore
  • 41
  • 5
  • https://stackoverflow.com/questions/7789038/c-sharp-wont-load-a-certain-xml-but-works-in-browser this is an exact replica of the same problem for me. However, the solution did not work. – Ignore Jan 15 '20 at 17:29