Clear SSL client certificate state from JavaScript

后端 未结 3 1220
谎友^
谎友^ 2020-12-16 01:51

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 req

相关标签:
3条回答
  • 2020-12-16 02:19

    For Chrome (at least in 19.0.1084.30 beta), it seems that, if you can set up a URL on the same hostname that requires a client certificate but rejects all certificates, then making a request to that URL will have the same effect as window.crypto.logout(). For example, if /ssl_logout/ is the specially-configured URL:

    var xmlHttp = new XMLHttpRequest();
    xmlHttp.onreadystatechange = function () {
        // put any actions to carry out upon logout here
    };
    xmlHttp.open( "GET", "/ssl_logout/", true );
    xmlHttp.send();
    

    (Using a page containing an iframe or img with src="/ssl_logout/" works, too.)

    0 讨论(0)
  • 2020-12-16 02:27

    In IE6+:

    document.execCommand('ClearAuthenticationCache');
    
    0 讨论(0)
  • 2020-12-16 02:28

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

    if (window.crypto) window.crypto.logout();
    
    0 讨论(0)
提交回复
热议问题