Fixed serious issues with SSL config and certificate authentication