       catch err
         logger.error "Failed to lookup client: #{err}"
 
-      if this.authenticated?
+        # MyEdit
+      #lookup client in revocation list
+      try
+        revoked = yield revokedLookup cert.fingerprint, cert.issuer.CN
+      catch err
+        logger.error "Failed to lookup client for revocation: #{err}"
+      
+      # Edited - MyEdit May 25
+      if this.authenticated? and not revoked
         sdc.timing "#{domain}.tlsAuthenticationMiddleware", startTime if statsdServer.enabled
         this.authenticationType = 'tls'
+        yield next
+      else if revoked?
+        this.authenticated = null
+        logger.info "Certificate Authentication Failed: revoked cert - fingerprint: #{cert.fingerprint} issuer: #{cert.issuerCN}, trying next auth mechanism if any..."
+        sdc.timing "#{domain}.tlsAuthenticationMiddleware", startTime if statsdServer.enabled
         yield next
       else
         this.authenticated = null

        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

###
# Koa middleware for mutual TLS authentication

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
