'Permission denied' error while using https request in the javascript's Microsoft.XMLHTTP open() function.

Posted on 2004-09-02
Medium Priority
Last Modified: 2012-05-05
Hi all,

I have written a http based RPC server. And I am trying invoke one of the RPC methods in a javascript using XMLHTTP.
I am able to do it when making using http requests.
But with https, it fails due to "permission denied" error.

oHttp = new ActiveXObject("Microsoft.XMLHTTP");
oHttp.open("POST", "https://localhost:383/com.ov.jmc.ovjmc", false);

oHttp.open is the function throwing this error when the uri contains https.

I have imported the proper certificates in my browser, and the normal https request looks working through browser.

Please help me solving this problem asap..

Question by:sathishpy
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
LVL 36

Expert Comment

ID: 11962091

Hmm... That is odd. You can have this:

oHttp = (document.all) ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
oHttp.open("POST", "https://localhost:383/com.ov.jmc.ovjmc", false, username, password);
if (oHttp.readyState==4) {


Author Comment

ID: 11962818
Hi Zyloch,

Thanks for your resply...But my problem is not fully solved....
I included your code. Now it is not giving 'permission denied' error. Still I am not getting the response like my http request.
Also my RPC Server doesn't require any authentication. Only a valid certificate is enough to access the method. In that case what should I mention in username and passwd field. If I put empty string there, again I am getting the same error.

LVL 36

Expert Comment

ID: 11964859
The empty string should work, or you could just omit it and use oHttp.open("POST", "https://localhost:383/com.ov.jmc.ovjmc", false);

You could try changing the false to true and see what happens. You can also include this to test:

document.write(oHttp.status+"\n");     //Sorry about the echo(). I was thinking PHP by accident


Author Comment

ID: 11970395
Don't know what is happening...

   oHttp.open("POST", "http://localhost:383/com.ov.jmc.ovjmc", false);
    alert("Error Name:"+e.name);
    alert("Error message:"+e.message);
This always runs without any problems...

   oHttp.open("POST", "https://localhost:383/com.ov.jmc.ovjmc", false);
   oHttp.open("POST", "https://localhost:383/com.ov.jmc.ovjmc", true);
   oHttp.open("POST", "https://localhost:383/com.ov.jmc.ovjmc", false,"","");
All these are throwing the exception with
Error Name:Error
Error Message:permission denied

   oHttp.open("POST", "https://localhost:383/com.ov.jmc.ovjmc", false,"temp","temp");
This will not throw any error, but with this oHttp.send is throwing an error having no message.

Any idea what happens exactly when oHttp.open is called? Will it send the certificate during this call or it is sent while calling oHttp.send() is called?
LVL 36

Accepted Solution

Zyloch earned 1000 total points
ID: 12012065
I'm not too sure as I've not used this often, it could be because https is restricted to only your domain, because most Permission or Access Denied errors result from cross domain calling when it's not allowed.


Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question