Reduce complexity of check_certificate_expiration