tidy verify code. xn not used any more and check for self signed more efficiently