More changes to support x509 authentication