Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions web/pgadmin/misc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
import time
import json
import os
import sys
import ssl
from urllib.request import urlopen
from pgadmin.settings import get_setting, store_setting

Expand Down Expand Up @@ -345,8 +347,16 @@ def upgrade_check():
# Do not wait for more than 5 seconds.
# It stuck on rendering the browser.html, while working in the
# broken network.
if os.path.exists(config.CA_FILE):
response = urlopen(url, data, 5, cafile=config.CA_FILE)
if os.path.exists(config.CA_FILE) and sys.version_info >= (
3, 13):
# Use SSL context for Python 3.13+
context = ssl.create_default_context(cafile=config.CA_FILE)
response = urlopen(url, data=data, timeout=5,
context=context)
elif os.path.exists(config.CA_FILE):
# Use cafile parameter for older versions
response = urlopen(url, data=data, timeout=5,
cafile=config.CA_FILE)
else:
response = urlopen(url, data, 5)
current_app.logger.debug(
Expand Down
Loading