Include a cacert file when needed for the upgrade check. Fixes #3185

This commit is contained in:
Dave Page
2018-07-23 16:15:58 +01:00
parent 58ef723476
commit d7eb41fff4
4 changed files with 14 additions and 3 deletions

View File

@@ -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()
)