|
43 | 43 | from pymongo import MongoClient, ssl_support
|
44 | 44 | from pymongo.errors import ConfigurationError, ConnectionFailure, OperationFailure
|
45 | 45 | from pymongo.hello import HelloCompat
|
46 |
| -from pymongo.ssl_support import HAVE_SSL, _ssl, get_ssl_context |
| 46 | +from pymongo.ssl_support import HAVE_SSL, _pyssl, _ssl, get_ssl_context |
47 | 47 | from pymongo.write_concern import WriteConcern
|
48 | 48 |
|
49 | 49 | _HAVE_PYOPENSSL = False
|
@@ -134,7 +134,7 @@ def test_config_ssl(self):
|
134 | 134 |
|
135 | 135 | @unittest.skipUnless(_HAVE_PYOPENSSL, "PyOpenSSL is not available.")
|
136 | 136 | def test_use_pyopenssl_when_available(self):
|
137 |
| - self.assertTrue(_ssl.IS_PYOPENSSL) |
| 137 | + self.assertTrue(_pyssl.IS_PYOPENSSL) |
138 | 138 |
|
139 | 139 | @unittest.skipUnless(_HAVE_PYOPENSSL, "Cannot test without PyOpenSSL")
|
140 | 140 | def test_load_trusted_ca_certs(self):
|
@@ -177,7 +177,7 @@ def test_tlsCertificateKeyFilePassword(self):
|
177 | 177 | #
|
178 | 178 | # --sslPEMKeyFile=/path/to/pymongo/test/certificates/server.pem
|
179 | 179 | # --sslCAFile=/path/to/pymongo/test/certificates/ca.pem
|
180 |
| - if not hasattr(ssl, "SSLContext") and not _ssl.IS_PYOPENSSL: |
| 180 | + if not hasattr(ssl, "SSLContext") and not _pyssl.IS_PYOPENSSL: |
181 | 181 | self.assertRaises(
|
182 | 182 | ConfigurationError,
|
183 | 183 | self.simple_client,
|
@@ -378,7 +378,7 @@ def test_cert_ssl_validation_hostname_matching(self):
|
378 | 378 | @client_context.require_tlsCertificateKeyFile
|
379 | 379 | @ignore_deprecations
|
380 | 380 | def test_tlsCRLFile_support(self):
|
381 |
| - if not hasattr(ssl, "VERIFY_CRL_CHECK_LEAF") or _ssl.IS_PYOPENSSL: |
| 381 | + if not hasattr(ssl, "VERIFY_CRL_CHECK_LEAF") or _pyssl.IS_PYOPENSSL: |
382 | 382 | self.assertRaises(
|
383 | 383 | ConfigurationError,
|
384 | 384 | self.simple_client,
|
@@ -660,7 +660,7 @@ def remove(path):
|
660 | 660 | @client_context.require_async
|
661 | 661 | @unittest.skipUnless(_HAVE_PYOPENSSL, "PyOpenSSL is not available.")
|
662 | 662 | @unittest.skipUnless(HAVE_SSL, "The ssl module is not available.")
|
663 |
| - def test_pyopenssl_not_ignored_in_async(self): |
| 663 | + def test_pyopenssl_ignored_in_async(self): |
664 | 664 | client = MongoClient("mongodb://localhost:27017?tls=true&tlsAllowInvalidCertificates=true")
|
665 | 665 | client.admin.command("ping") # command doesn't matter, just needs it to connect
|
666 | 666 | client.close()
|
|
0 commit comments