从javascript清除SSL客户端证书状态 [英] Clear ssl client certificate state from javascript

查看:481
本文介绍了从javascript清除SSL客户端证书状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在ssl会话中使用客户端证书来验证用户,但我对缓存的会话有一点问题。 (我已经配置IIS接受(不需要)客户端证书)

I'm using client certificates in ssl sessions to authenticate users but I'm having a bit of a problem with cached sessions. (I have configured IIS to accept (not require) client certificates)

正常情况:
用户访问的页面是证书被询问。浏览器启动证书选择器,用户选择所需的证书(如果需要,插入PIN),一切正常。

Normal situation: A user access the page were the certificate is asked. The browser launches the certificate selector, the user selects the desired certificate (and insert PIN if needed) and everything goes forward as it should.

情况无效如预期:
用户访问的页面是证书被问。浏览器启动证书选择器,用户选择所需的证书,然后取消PIN对话框。用户被重定向到上一页,因为没有发送证书。

Situation were it doesn't work as expected: A user access the page were the certificate is asked. The browser launches the certificate selector, the user selects the wanted certificate but then cancels the PIN dialog. The user is redirected to the previous page because no certificate was sent. The user tries to login again but it automatically fails because the last ssl session was cached.

我使用document.execCommand(ClearAuthenticationCache)解决了这个问题。但它仍然不工作在FF和铬,因为他们不支持这种方法。

I solved this in ie using document.execCommand("ClearAuthenticationCache"); but it still doesn't work in FF and chrome because they don't support such method. Is there anyway to solve this?

推荐答案

您可能对此讨论此Chromium问题。特别是,你应该尝试:

You may be interested in this discussion and this Chromium issue. In particular, you should try:

if (window.crypto) window.crypto.logout();

这篇关于从javascript清除SSL客户端证书状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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