 
     else
       return done(new Error 'Keystore does not exist')
-    
+
     if mutualTLS
       exports.getTrustedClientCerts (err, certs) ->
         if err


      ## MyEdit - May 24
      ## Since we have found a cert-client match, (CA chaining or not)
      ## we can heck here for revocation list match. 
      ## 
      revoked = false
      RevokedCert.findOne {certFingerprint: fingerprint, issuerDN: issuerCN}, (err,result) ->
        if err
          return deferred.reject err
        if not result?
          logger.info "Certificate for cn=#{subjectCN} issuerCN=#{issuerCN} is in revocation list."
          revoked = true
      ######
      if revoked?
        return deferred.resolve null
      return deferred.resolve result

    if subjectCN is issuerCN
      # top certificate reached

        logger.warn "tlsClientLookup.type config option does not contain a known value, defaulting to 'strict'. Available options are 'strict' and 'in-chain'."
      deferred.resolve null

  (Q.all promises).then ->
    return deferred.promise
  return

if process.env.NODE_ENV == "test"
  exports.clientLookup = clientLookup
