且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用XHR发送客户端证书

更新时间:2022-10-25 08:06:09

我不认为这是可能的。

除此之外,同源政策很可能会给你带来问题。


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 don't think that's possible.

Besides that, the same origin policy would most likely cause problems for you.