File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed
Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -72,17 +72,24 @@ def get_os_sslcertfile_searchpath():
7272 at all.
7373 """
7474 os_name = get_os_name ()
75- location = __DEF_OS_LOCATIONS .get (os_name , ['' ])
75+ location = __DEF_OS_LOCATIONS .get (os_name , [])
7676
7777 try :
7878 import ssl
7979 verify_paths = ssl .get_default_verify_paths ()
80- location += [os .getenv (verify_paths .openssl_cafile_env ) or '' ]
81- location += [verify_paths .cafile or '' ]
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 ]
8289 except AttributeError :
8390 pass
8491 finally :
85- if location . count ( '' ) == len ( location ) :
92+ if len ( location ) == 0 :
8693 return None
8794
8895 return location
You can’t perform that action at this time.
0 commit comments