Tuesday, 30 May 2017

Checking in nodeJS Express if IIS Client Cert Authentication went ok

I have some client machines that connect to my IIS server using client certificate authorization. I have a node.js webapp published on IIS (using iisnode) that receives the requests from the clients.

Is there a way in express to know if the authentication was ok? I know that if the authentication was not ok the http request does not reach to express because it is rejected but I need a field to check if it was ok, because I access the same webapp without ssl and I this particar request only needs to be called if the call was using the client ssl authentication.

I tried with req.socket.authorized but it is undefined and with req.socket.getPeerCertificate(true) I am getting TypeError: req.socket.getPeerCertificate is not a function



via Egidi

No comments:

Post a Comment