(self)
| 473 | ) |
| 474 | |
| 475 | def test_system_certs_config_error(self): |
| 476 | ctx = get_ssl_context(None, None, None, None, True, True, False, _IS_SYNC) |
| 477 | if (sys.platform != "win32" and hasattr(ctx, "set_default_verify_paths")) or hasattr( |
| 478 | ctx, "load_default_certs" |
| 479 | ): |
| 480 | raise SkipTest("Can't test when system CA certificates are loadable.") |
| 481 | |
| 482 | have_certifi = ssl_support.HAVE_CERTIFI |
| 483 | have_wincertstore = ssl_support.HAVE_WINCERTSTORE |
| 484 | # Force the test regardless of environment. |
| 485 | ssl_support.HAVE_CERTIFI = False |
| 486 | ssl_support.HAVE_WINCERTSTORE = False |
| 487 | try: |
| 488 | with self.assertRaises(ConfigurationError): |
| 489 | self.simple_client("mongodb://localhost/?ssl=true") |
| 490 | finally: |
| 491 | ssl_support.HAVE_CERTIFI = have_certifi |
| 492 | ssl_support.HAVE_WINCERTSTORE = have_wincertstore |
| 493 | |
| 494 | def test_certifi_support(self): |
| 495 | if hasattr(ssl, "SSLContext"): |
nothing calls this directly
no test coverage detected