def validate_allow_invalid_certs(option, value):
        """Validate the option to allow invalid certificates is valid."""
        # Avoid circular import.
        from pymongo.common import validate_boolean_or_string
        boolean_cert_reqs = validate_boolean_or_string(option, value)
        if boolean_cert_reqs:
            return ssl.CERT_NONE
        return ssl.CERT_REQUIRED
Validate the option to allow invalid certificates is valid.
stackoverflow/venv/lib/python3.6/site-packages/pymongo/ssl_support.py