Cert-based user auth updates

* change user matching to use the CN instead of email address
* added code for operating behind an SSL-terminating reverse proxy
Fix for new cert auth changes

Authentication module was trying to find users based on email
instead of username.
Changed client cert test config file to have a username instead of
a hostname.
Fixed typo in config template.