Skip to content

Commit 7462a6a

Browse files
Fixed the SSL certificate issue while checking for the upgrade. #9293
1 parent c3da32f commit 7462a6a

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ azure-mgmt-resource==24.0.0
1919
azure-mgmt-subscription==3.1.1
2020
bcrypt==5.0.*
2121
boto3==1.42.*
22+
certifi==2025.11.12
2223
cryptography==46.0.*
2324
Flask-Babel==4.0.*
2425
Flask-Compress==1.*

web/pgadmin/misc/__init__.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
"""A blueprint module providing utility functions for the application."""
1111

12+
import certifi
1213
from pgadmin.utils import driver
1314
from flask import request, current_app
1415
from flask_babel import gettext
@@ -371,18 +372,22 @@ def upgrade_check():
371372
# Do not wait for more than 5 seconds.
372373
# It stuck on rendering the browser.html, while working in the
373374
# broken network.
374-
if os.path.exists(config.CA_FILE) and sys.version_info >= (
375+
if sys.version_info >= (
375376
3, 13):
376377
# Use SSL context for Python 3.13+
377-
context = ssl.create_default_context(cafile=config.CA_FILE)
378+
if os.path.exists(config.CA_FILE):
379+
context = ssl.create_default_context(cafile=config.CA_FILE)
380+
else:
381+
context = ssl.create_default_context(certifi.where())
382+
378383
response = urlopen(url, data=data, timeout=5,
379384
context=context)
380385
elif os.path.exists(config.CA_FILE):
381386
# Use cafile parameter for older versions
382387
response = urlopen(url, data=data, timeout=5,
383388
cafile=config.CA_FILE)
384389
else:
385-
response = urlopen(url, data, 5)
390+
response = urlopen(url, data, 5, cafile=certifi.where())
386391
current_app.logger.debug(
387392
'Version check HTTP response code: %d' % response.getcode()
388393
)

0 commit comments

Comments
 (0)