mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Include a cacert file when needed for the upgrade check. Fixes #3185
This commit is contained in:
@@ -294,6 +294,11 @@ UPGRADE_CHECK_ENABLED = True
|
||||
# Where should we get the data from?
|
||||
UPGRADE_CHECK_URL = 'https://www.pgadmin.org/versions.json'
|
||||
|
||||
# Which CA file should we use?
|
||||
# Default to cacert.pem in the same directory as config.py et al.
|
||||
CA_FILE = os.path.join(os.path.dirname(os.path.realpath(__file__)),
|
||||
"cacert.pem")
|
||||
|
||||
##########################################################################
|
||||
# Storage Manager storage url config settings
|
||||
# If user sets STORAGE_DIR to empty it will show all volumes if platform
|
||||
@@ -399,4 +404,3 @@ if (SUPPORT_SSH_TUNNEL is True and
|
||||
((sys.version_info[0] == 2 and sys.version_info[1] < 7) or
|
||||
(sys.version_info[0] == 3 and sys.version_info[1] < 4))):
|
||||
SUPPORT_SSH_TUNNEL = False
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
import json
|
||||
import logging
|
||||
import os
|
||||
from abc import ABCMeta, abstractmethod, abstractproperty
|
||||
from smtplib import SMTPConnectError, SMTPResponseException, \
|
||||
SMTPServerDisconnected, SMTPDataError, SMTPHeloError, SMTPException, \
|
||||
@@ -505,7 +506,10 @@ def index():
|
||||
# Do not wait for more than 5 seconds.
|
||||
# It stuck on rendering the browser.html, while working in the
|
||||
# broken network.
|
||||
response = urlreq.urlopen(url, data, 5)
|
||||
if os.path.exists(config.CA_FILE):
|
||||
response = urlreq.urlopen(url, data, 5, cafile=config.CA_FILE)
|
||||
else:
|
||||
response = urlreq.urlopen(url, data, 5)
|
||||
current_app.logger.debug(
|
||||
'Version check HTTP response code: %d' % response.getcode()
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user