File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -357,9 +357,16 @@ def upgrade_check():
357357 # Do not wait for more than 5 seconds.
358358 # It stuck on rendering the browser.html, while working in the
359359 # broken network.
360- if os .path .exists (config .CA_FILE ):
361- response = urlopen_with_ssl (
362- url , data , 5 , config .CA_FILE )
360+ if os .path .exists (config .CA_FILE ) and sys .version_info >= (
361+ 3 , 13 ):
362+ # Use SSL context for Python 3.13+
363+ context = ssl .create_default_context (cafile = config .CA_FILE )
364+ response = urlopen (url , data = data , timeout = 5 ,
365+ context = context )
366+ elif os .path .exists (config .CA_FILE ):
367+ # Use cafile parameter for older versions
368+ response = urlopen (url , data = data , timeout = 5 ,
369+ cafile = config .CA_FILE )
363370 else :
364371 response = urlopen (url , data , 5 )
365372 current_app .logger .debug (
You can’t perform that action at this time.
0 commit comments