'Test setting sslCertificatePolicy.'

def test_ssl_validation(self):

    for ssl_cert_req in ['required', 'optional']:
        no_ca_config = {'ssl': {'sslCertificatePolicy': ssl_cert_req}}
        if (pymongo.version_tuple < (3, 0)):
            self.assertRaises(errors.InvalidConfiguration, self.load_json, no_ca_config)
        else:
            self.load_json(no_ca_config)
    self.assertRaises(errors.InvalidConfiguration, self.load_json, {'ssl': {'sslCACerts': 'ca.pem', 'sslCertificatePolicy': 'invalid'}})
