通过JavaScript发送客户端证书。 [英] Sending client certificate via JavaScript.

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

问题描述

如何在JavaScript中自动通过客户端证书(我正在使用XmlHttpRequest进行调用)?如果这是不可能的(根据我的阅读,不是因为浏览器决定了此安全方面,而不是其中运行的JavaScript),那么我是否可以提示用户在事件单击时选择客户端证书? ?还有其他方法可以做到这一点吗?该代码将在IE中运行。

How to pass a client certificate automatically in JavaScript (I am using XmlHttpRequest to make the call)? If this is not possible (and from what I have read it isn't because it is the browser which determines this security aspect and not the javascript running within it) then can I atleast prompt the user to select a client certificate on an event click? Any other way to accomplish this? The code will run in IE.

当我连接到URL时,我目前正在获取HTTP禁止访问(请求客户端证书)。没有任何类似于我直接从浏览器窗口中调用此URL时所得到的客户端证书选择的提示。由于我能够连接到URL,因此我假设我不会遇到任何CORS特定问题。

I am currently getting an HTTP Forbidden (requesting a client certificate) when I connect to the URL. There is no prompt for any client cert selection similar to what I get when I call this URL directly from my browser window. Since I am able to connect to the URL, I presume that I am not going to run into any CORS specific issue.

有关更多详细信息-这是我尝试在Javascript中实现的功能: http://msdn.microsoft.com/en-us/library/dn458823.aspx
谢谢!

For more details - here is what I am trying to accompalish in Javascript: http://msdn.microsoft.com/en-us/library/dn458823.aspx Thanks!

推荐答案

在建立HTTPS连接之前,客户端证书交换发生在SSL握手期间。当您的应用程序正常运行时,这一切都发生在第5层的浏览器中在第7层中。您完全不会影响JavaScript中的客户端证书交换。

The client certificate exchange happens during the SSL handshake, before the HTTPS connection is established. It all happens in the browser at layer 5 while your application is working at layer 7. You can't affect client certificate exchange in JavaScript at all.

如果未进行交换,则服务器或浏览器中存在配置问题。如果客户端证书已安装在浏览器中,它将自动发送,以响应服务器发出的匹配客户端证书请求。如果这没有发生,则说明配置错误。

If the exchange is not happening there is a configuration issue on the server or in the browser. If the client certificate is installed in the browser, it will automatically be sent in response to a matching client certificate request from the server. If that's not happening then something is misconfigured.

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

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