From 67de7a4c91c094904df4d0dd69fdc24056285b20 Mon Sep 17 00:00:00 2001 From: Khushboo Vashi Date: Wed, 17 Dec 2025 16:26:47 +0530 Subject: [PATCH 1/2] Fixed the SSL certificate issue while checking for the upgrade. #9293 --- requirements.txt | 1 + web/pgadmin/misc/__init__.py | 13 +++++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/requirements.txt b/requirements.txt index d81eb323974..1de136d8d30 100644 --- a/requirements.txt +++ b/requirements.txt @@ -19,6 +19,7 @@ azure-mgmt-resource==24.0.0 azure-mgmt-subscription==3.1.1 bcrypt==5.0.* boto3==1.42.* +certifi==2025.11.12 cryptography==46.0.* Flask-Babel==4.0.* Flask-Compress==1.* diff --git a/web/pgadmin/misc/__init__.py b/web/pgadmin/misc/__init__.py index 43d0a655811..2fe1e5228b0 100644 --- a/web/pgadmin/misc/__init__.py +++ b/web/pgadmin/misc/__init__.py @@ -9,6 +9,7 @@ """A blueprint module providing utility functions for the application.""" +import certifi from pgadmin.utils import driver from flask import request, current_app from flask_babel import gettext @@ -371,18 +372,22 @@ 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) and sys.version_info >= ( + if sys.version_info >= ( 3, 13): # Use SSL context for Python 3.13+ - context = ssl.create_default_context(cafile=config.CA_FILE) + if os.path.exists(config.CA_FILE): + context = ssl.create_default_context(cafile=config.CA_FILE) + else: + context = ssl.create_default_context(certifi.where()) + response = urlopen(url, data=data, timeout=5, - context=context) + 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) + response = urlopen(url, data, 5, cafile=certifi.where()) current_app.logger.debug( 'Version check HTTP response code: %d' % response.getcode() ) From 8af9160cb5a2ca2fdc5a8342024f4f447193ca9d Mon Sep 17 00:00:00 2001 From: Khushboo Vashi Date: Wed, 17 Dec 2025 16:30:55 +0530 Subject: [PATCH 2/2] Fix PEP-8 issue. --- web/pgadmin/misc/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/pgadmin/misc/__init__.py b/web/pgadmin/misc/__init__.py index 2fe1e5228b0..d23d39755b4 100644 --- a/web/pgadmin/misc/__init__.py +++ b/web/pgadmin/misc/__init__.py @@ -381,7 +381,7 @@ def upgrade_check(): context = ssl.create_default_context(certifi.where()) response = urlopen(url, data=data, timeout=5, - context=context) + context=context) elif os.path.exists(config.CA_FILE): # Use cafile parameter for older versions response = urlopen(url, data=data, timeout=5,