         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
+
+  return deferred.promise
+
 
 if process.env.NODE_ENV == "test"
   exports.clientLookup = clientLookup
+
+### MyEdit May 25
+# Revocation
+###
+revokedLookup = (fingerprint, issuerCN) ->
+  logger.debug "Looking up client linked in revocation list"
+  deferred = Q.defer()
+  
+
+  RevokedCert.findOne {fingerprint: fingerprint, issuerDN: issuerCN}, (err, result) ->
+    deferred.reject err if err
+
+    if result?
+      # found a match
+      return deferred.resolve result
+
+    if config.tlsClientLookup.type is 'in-chain'
+      # walk further up and cert chain and check
+      utils.getKeystore (err, keystore) ->
+        deferred.reject err if err
+        missedMatches = 0
+        # find the isser cert
+        if not keystore.ca? || keystore.ca.length < 1
+          logger.info "Issuer cn=#{issuerCN} for cn=#{subjectCN} not found in keystore."
+          deferred.resolve null
+        else
+          for cert in keystore.ca
+            do (cert) ->
+              pem.readCertificateInfo cert.data, (err, info) ->
+                if err
+                  return deferred.reject err
+
+                if info.commonName is issuerCN
+                  promise = revokedLookup cert.fingerprint, info.commonName, info.issuer.commonName
+                  promise.then (result) -> deferred.resolve result
+                else
+                  missedMatches++
+
+                if missedMatches is keystore.ca.length
+                  logger.info "Issuer cn=#{issuerCN} for cn=#{subjectCN} not found in keystore."
+                  deferred.resolve null
+    else
+      if config.tlsClientLookup.type isnt 'strict'
+        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
 
 ###
 # Koa middleware for mutual TLS authentication

      catch err
        logger.error "Failed to lookup client: #{err}"

      if this.authenticated?
        sdc.timing "#{domain}.tlsAuthenticationMiddleware", startTime if statsdServer.enabled
        this.authenticationType = 'tls'
        yield next
      else
        this.authenticated = null

clientLookup = (fingerprint, subjectCN, issuerCN) ->
  logger.debug "Looking up client linked to cert with fingerprint #{fingerprint} with subject #{subjectCN} and issuer #{issuerCN}"
  deferred = Q.defer()
  

  Client.findOne certFingerprint: fingerprint, (err, result) ->
    deferred.reject err if err

    if result?
      # found a match
      return deferred.resolve result

    if subjectCN is issuerCN
      # top certificate reached
