First working version with client cert authentication