support for client authentication based on certs

Hello,

Submitting a patch to support client authentication using certificates. I am using this to build a non-UI client written in C against a nodejs-based  web socket server. 

The ifndef is probably not needed, please feel free to remove it.

HTH,
Prasanna