Add and use certificate validation helper