mirror of
https://github.com/python/cpython.git
synced 2025-10-21 06:02:21 +00:00
Issue #18143: Implement ssl.get_default_verify_paths() in order to debug
the default locations for cafile and capath.
This commit is contained in:
parent
302b8c31ec
commit
6d7ad13a45
5 changed files with 97 additions and 1 deletions
|
@ -394,6 +394,19 @@ class BasicSocketTests(unittest.TestCase):
|
|||
support.gc_collect()
|
||||
self.assertIn(r, str(cm.warning.args[0]))
|
||||
|
||||
def test_get_default_verify_paths(self):
|
||||
paths = ssl.get_default_verify_paths()
|
||||
self.assertEqual(len(paths), 6)
|
||||
self.assertIsInstance(paths, ssl.DefaultVerifyPaths)
|
||||
|
||||
with support.EnvironmentVarGuard() as env:
|
||||
env["SSL_CERT_DIR"] = CAPATH
|
||||
env["SSL_CERT_FILE"] = CERTFILE
|
||||
paths = ssl.get_default_verify_paths()
|
||||
self.assertEqual(paths.cafile, CERTFILE)
|
||||
self.assertEqual(paths.capath, CAPATH)
|
||||
|
||||
|
||||
class ContextTests(unittest.TestCase):
|
||||
|
||||
@skip_if_broken_ubuntu_ssl
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue