Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IE https CORS XHR request fails with Script7002: XMLHttpRequest: Network Error 0x2eff

In all other non-IE browsers, the following code snippet works great:

<!DOCTYPE html>
<html>
<script type="text/javascript">
var xhr = new XMLHttpRequest();
var url = "https://otherdomain.com";
var method = "GET";
xhr.open(method, url, true);

xhr.onload = function() {
 var responseText = xhr.responseText;
 document.write(responseText);
};

xhr.send()

</script>
</html>

In two different IE11 browsers (running on different OS versions), I get two different errors:

  1. IE11 Win7: Script7002: XMLHttpRequest: Network Error 0x80070005, Access is denied.
  2. IE11 Win8: Script7002: XMLHttpRequest: Network Error 0x2eff Could not complete the operation due to error 00002eff

Google searches for the above error codes don't turn up anything useful. I've tried setting Content-Type, adding dummy functions for onprogress and onload, to no avail.

like image 462
senor_bacon Avatar asked Sep 18 '14 20:09

senor_bacon


1 Answers

Figured it out.

In our case, on a previous project we had changed which SSL protocols were allowed by IE to us. Ajax requests were failing because IE was not allowed to negotiate the SSL handshakes based on the custom configuration.

Solution was to open up Internet Options, choose the Advanced tab, and then click the "Restore Advanced Settings" button. After that the Ajax requests worked fine.

Hopefully this saves someone else the 6 hours or so I spent on this!

like image 141
senor_bacon Avatar answered Oct 21 '22 11:10

senor_bacon