All the facts:
I have a program that communicates with an external system using ajax.
Calls are defined using amplify.js/jq
As I need crossdomain support for IE8 I am using a haxe script which proxies the calls for me and it replaces the xhr
object with its shr
implementation (SWFHttpRequest
):
This xhr object modification is done like this:
amplify.subscribe("request.before.ajax", function (resource, settings, ajaxSettings, xhr) {
if ($.browser.msie || !!navigator.userAgent.match(/Trident\/7\./)) {
if (resource.url.indexOf(requestConfig.apiUrl) != -1) {
var shr = new SWFHttpRequest(); // flash object adds this guy
ajaxSettings.xhr = function () {
return shr;
};
ajaxSettings.crossDomain = false;
ajaxSettings.error = function (e) {
var errorDialog = new gDialog({
title: "Error",
text: "Sorry, but there was an error in requesting information from our servers. Please contact support and provide the following information: response:"
+ e.responseText + " statusText: "
+ e.statusText + " status: "
+ e.status + " from url: " + resource.url
})
};
}
}
});
Everything works OK in non ie browsers over SSL and Http (no surprise here)
Everything works OK in IE8+ over HTTP and 9+ over HTTPS
In IE8 when over HTTPS the call has this response header:
HTTP/1.1 200 OK
Cache-Control: no-cache
Pragma: no-cache
Content-Type: application/json
Expires: -1
Server: Microsoft-IIS/7.5
X-AspNet-Version: 4.0.30319
Access-Control-Allow-Methods: *
Access-Control-Allow-Credentials: true
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: Access-Control-Allow-Headers, Content-Type, Accept
X-Powered-By: ASP.NET
Date: Fri, 30 May 2014 10:40:51 GMT
Content-Length: 283
{"ResponseCode":200,"ResponseDescription":"OK","ResponseEntity":"P4w0uZrc2BMOjdLBYF1K2RT9Ku/rTAqDK/2st76YdwhaqGZB/Yw2QCC03ncZJXqDdGYRyty+EDmOwx9MYgZdAtUdfmygjZrD0ST8G/qc4Iwbp7I/r+X5PPbI1QNoiy1VOe7WNgXt7g12UKpRKzXhWvGCUOItA8z1VrsBXLxUtd6p45SmOjrIycKWBVRLPP37cXokvO+uiGuur1p7wF392Q=="}
This is the correct response and I should succeed and go forward but instead ajaxSettings.error
tells me:
response:null
statusText: Not Found
status: 404
from url: the correct endpoint url with correct matching protocol
I am not sure what to think or where to look, really confused so any help or clue would be really appreciated.
Please let me know if any further relevant details you may think I should add here.
My clues and thoughts so far:
Apparently there are some issues on SSL with Microsoft.XMLDOM
So I thought maybe I also include the section of the haxe script which is referencing that:
public function onData( data:String ) {
if (!this.active) return;
var stringified = haxe.Json.stringify(haxe.Json.parse(data));
var striginiedEscaped = StringTools.replace(stringified, "\\", "\\\\");
ExternalInterface.call( [ "(function(instance, data){",
"var shr = window.SWFHttpRequest.instances[instance];",
"if (!shr) return;",
"shr.status = 200;",
"shr.statusText = 'OK';",
"shr.readyState = 4;",
"shr.responseText = data;",
"try {",
"if (window.DOMParser) {",
"var dp = new DOMParser();",
"shr.responseXML = dp.parseFromString( data, 'text/xml' );",
"} else {",
"shr.responseXML = new ActiveXObject('Microsoft.XMLDOM');",
"shr.responseXML.async = 'false';",
"shr.responseXML.loadXML(data);",
"}",
"} catch(error) { shr.responseXML = null; }",
"if (shr.onreadystatechange && typeof shr.onreadystatechange=='function') shr.onreadystatechange();",
"})" ].join(''), this.instance, striginiedEscaped);
}
According to this page Microsoft.XMLDOM has issues with SSL and I should make sure:
Has anyone dealt with this issue before? Will be applying these and report back.
Ok, Thought I add the answer if there is still another soul in this day and age who has to deal with this.
This indeed was: Microsoft.XMLDOM has issues with SSL
this does the job:
1. clear the Do not save encrypted pages to disk check box in IE
2. Cache-Control: no-transform,public,max-age=300,s-maxage=900