I'm trying to open an ssl service with java script. In order to do so, I need to send my certificate with xmlhttp object. Can I do it with java script? I could not find how to do it anywhere.
my code looks like this:
xmlhttp.open("post","https://[some ip]:[some secured port]",false);
xmlhttp.send();
However it's not working. On the other hand, when using: "https://[some ip]:[some secured port]" - directly from my browser - It is telling me to choose a certificate and it's working well.
How can I make it work straight from the java script? What should be the solution to my situation?
I'm trying to open an ssl service with java script. In order to do so, I need to send my certificate with xmlhttp object. Can I do it with java script? I could not find how to do it anywhere.
my code looks like this:
xmlhttp.open("post","https://[some ip]:[some secured port]",false);
xmlhttp.send();
However it's not working. On the other hand, when using: "https://[some ip]:[some secured port]" - directly from my browser - It is telling me to choose a certificate and it's working well.
How can I make it work straight from the java script? What should be the solution to my situation?
Share Improve this question edited Mar 11, 2012 at 11:52 matthewk 1,8411 gold badge17 silver badges31 bronze badges asked Mar 11, 2012 at 10:51 user967710user967710 2,0073 gold badges36 silver badges62 bronze badges 1- you might wanna read this extensive talk about a similar issue: stackoverflow./q/9542772/575527 – Joseph Commented Mar 11, 2012 at 11:06
2 Answers
Reset to default 4I don't think that's possible.
Besides that, the same origin policy would most likely cause problems for you.
There's one solution you might consider. If you detect that the certificate is absent, you may try to create an iframe with 0 height and width and border: none (basically an invisible iframe), point it to the needed URL and then the browser displays the certificate selection window.
I tested that in Firefox and Edge, both seems to work with that workaround.