When I try to send an HTTP GET request via XMLHttpRequest, it works with insecure HTTP.
But when sending via HTTPS, different browsers gave different results:
In Firefox 3.0.2: - GET request does not reach the web server.
In IE 7: - The GET request reached the web server.
Is this because Firefox 3 is becoming more stringent with untrusted certificates? Is there any way around this?
I already added the URL as an exception in Firefox Certificate Manager. The error console does not report an error. I added try-catch around XMLHttpRequest open () and submit. No exception selected.
Using an absolute and relative URL path does not work.
Here's the code snippet:
var xmlHttp;
try
{
xmlHttp=new XMLHttpRequest();
}
catch (e)
{
try
{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
try
{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e)
{
return false;
}
}
}
xmlHttp.onreadystatechange=function()
{
}
try
{
xmlHttp.open("GET", "/[relative path to request]", true);
xmlHttp.send(null);
}
catch (e)
{
alert('Error sending HTTP GET request!');
return false;
}
Thanks Kenneth
source
share