使用XHR发送客户端证书 [英] Send client certificate using XHR

查看:346
本文介绍了使用XHR发送客户端证书的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图用java脚本打开ssl服务。
为了这样做,我需要发送我的证书与xmlhttp对象。
我可以用java脚本吗?



我的代码如下所示:

 

code> xmlhttp.open(post,https:// [some ip]:[some secured port],false);
xmlhttp.send();

但它不工作。另一方面,当使用:
https:// [some ip]:[一些安全端口] - 直接从我的浏览器 - 这是告诉我选择一个证书,它的工作很好。 >

如何使它从java脚本直接工作?
我的情况应该是什么解决方案?

解决方案

我不认为这是可能的。

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


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.

这篇关于使用XHR发送客户端证书的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆