src/C++/Mozilla/old_snapshots/manager/pki/resources/content/exceptionDialog.js
/**
 * Attempt to download the certificate for the location specified, and populate
 * the Certificate Status section with the result.
 */
Attempt to download the certificate for the location specified, and populate
the Certificate Status section with the result.
Attempt to download the certificate for the location specified and populate the Certificate Status section with the result .
function checkCert() {
  gCert = null;
  gSSLStatus = null;
  gChecking = true;
  gBroken = false;
  updateCertStatus();
  var uri = getURI();
  if (findRecentBadCert(uri) == true)
    return;
  var req = new XMLHttpRequest();
  try {
    if(uri) {
      req.open('GET', uri.prePath, false);
      req.channel.notificationCallbacks = new badCertListener();
      req.send(null);
    }
  } catch (e) {
    Components.utils.reportError("Attempted to connect to a site with a bad certificate in the add exception dialog. " +
                                 "This results in a (mostly harmless) exception being thrown. " +
                                 "Logged for information purposes only: " + e);
  } finally {
    gChecking = false;
  }
  if(req.channel && req.channel.securityInfo) {
    const Ci = Components.interfaces;
    gSSLStatus = req.channel.securityInfo
                    .QueryInterface(Ci.nsISSLStatusProvider).SSLStatus;
    gCert = gSSLStatus.QueryInterface(Ci.nsISSLStatus).serverCert;
  }
  updateCertStatus();  
}
function checkCert ( ) { gCert = null ; gSSLStatus = null ; gChecking = true ; gBroken = false ; updateCertStatus ( ) ; var uri = getURI ( ) ; if ( findRecentBadCert ( uri ) == true ) return ; var req = new XMLHttpRequest ( ) ; try { if ( uri ) { req . open ( 'GET' , uri . prePath , false ) ; req . channel . notificationCallbacks = new badCertListener ( ) ; req . send ( null ) ; } } catch ( e ) { Components . utils . reportError ( "Attempted to connect to a site with a bad certificate in the add exception dialog. " + "This results in a (mostly harmless) exception being thrown. " + "Logged for information purposes only: " + e ) ; } finally { gChecking = false ; } if ( req . channel && req . channel . securityInfo ) { const Ci = Components . interfaces ; gSSLStatus = req . channel . securityInfo . QueryInterface ( Ci . nsISSLStatusProvider ) . SSLStatus ; gCert = gSSLStatus . QueryInterface ( Ci . nsISSLStatus ) . serverCert ; } updateCertStatus ( ) ; }
Attempt to download the certificate for the location specified, and populate
 the Certificate Status section with the result.
Attempt to download the certificate for the location specified and populate the Certificate Status section with the result .
// Is the cert already known in the list of recently seen bad certs? // We *expect* exceptions if there are problems with the certificate // presented by the site.  Log it, just in case, but we can proceed here, // with appropriate sanity checks