1

In IE 11 I have the following problem: I can't seem to make a CORS XMLHttpRequest from an SSL page to another SSL url on a different domain. It works in FF and Chrome. I cannot use XDomainRequest (deprecated), and I can't use jQuery or other libraries, must be javascript.

function test_Alert(){
    var request = new XMLHttpRequest();
    var params = "action=something";
    var xUrl= "https://some-domain.com?auth=123456&otherval=abcd");
    request.open('POST', xUrl, true);
    request.onreadystatechange = function() {if (request.readyState==4) alert("It worked!");};
    request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    request.setRequestHeader("Content-length", params.length);
    request.setRequestHeader("Connection", "close");
    request.send(params);
}

enter image description here

CORS is configured on the remote server, and it is working.

I CANNOT ask the clients to modify their client browsers settings.

I am able to do XMLHttpRequest calls to the local server using url="/dir/..." with no domain

Is there something I am missing or are SSL to SSL CORS requests in IE 11 not allowed or functioning? I believe I will be required to use the server as a proxy to call the url for this request which will be slow, but probably necessary if I can't resolve.

Even confirmation that what I am trying to do is not possible, or better yet an example of what I need to do to make it work. Any help is appreciated.

3
  • 1
    Is IE11 running as IE11? May 24, 2016 at 14:30
  • If you mean, am I running in compatability mode, no, I'm not. Emulation mode is set to default.
    – carlo
    May 24, 2016 at 14:37
  • Thanks, epascarello, this helped me find the problem!
    – carlo
    May 25, 2016 at 20:51

1 Answer 1

1

I ran a bunch of tests from different servers and the end result is that, yes, CORS works in SSL to SSL connections. The reason I was receiving the above error is because of the platform I am using for development. It includes a meta-tag in the html header of every page that runs emulation for IE

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE9" />

I can't remove the tag so I will see if there is a way to override.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.