Check certificate validity based on a pinned certificates.