admin管理员组文章数量:1331609
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.
本文标签: javascriptSend client certificate using XHRStack Overflow
版权声明:本文标题:javascript - Send client certificate using XHR - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742273231a2444701.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论