File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed
Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -72,7 +72,25 @@ def get_os_sslcertfile_searchpath():
7272 at all.
7373 """
7474 os_name = get_os_name ()
75- location = __DEF_OS_LOCATIONS .get (os_name , None )
75+ location = __DEF_OS_LOCATIONS .get (os_name , [])
76+
77+ try :
78+ import ssl
79+ verify_paths = ssl .get_default_verify_paths ()
80+ cafile_by_envvar = os .getenv (verify_paths .openssl_cafile_env )
81+ if cafile_by_envvar is not None :
82+ location += [cafile_by_envvar ]
83+ cafile_resolved = verify_paths .cafile
84+ if cafile_resolved is not None :
85+ location += [cafile_resolved ]
86+ cafile_hardcoded = verify_paths .openssl_cafile
87+ if cafile_hardcoded is not None :
88+ location += [cafile_hardcoded ]
89+ except AttributeError :
90+ pass
91+ finally :
92+ if len (location ) == 0 :
93+ return None
7694
7795 return location
7896
You can’t perform that action at this time.
0 commit comments