 clientLookup = (fingerprint, subjectCN, issuerCN) ->
   logger.debug "Looking up client linked to cert with fingerprint #{fingerprint} with subject #{subjectCN} and issuer #{issuerCN}"
   deferred = Q.defer()
-  
+  promises = []
+
   Client.findOne certFingerprint: fingerprint, (err, result) ->
     deferred.reject err if err
 

        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

  return deferred.promise

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


      ## MyEdit - May 24
      ## Since we have found a cert-client match, (CA chaining or not)
      ## we can heck here for revocation list match.
      ##
      revocation = (fp,issCN) ->
        deff = Q.defer()
        RevokedCert.findOne {fingerprint:fp, issuerDN: issCN}, (err,revoked) ->
          if err
            deff.reject err
          if revoked?
            logger.info "revoked: "
            deff.resolve null
          else
            logger.info "not revoked: " + result
            deff.resolve result
        return deff.promise


      promise_rev = revocation(fingerprint,issuerCN)
      promise_rev.then (res) ->
        logger.info "promise res: " + res
        return deferred.resolve res

      promises.push promise_rev
      ##
      #return deferred.resolve result

    if subjectCN is issuerCN
      # top certificate reached
