summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/services/mail/smtpbootstrapper.py
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2016-03-21 15:52:43 -0400
committerKali Kaneko <kali@leap.se>2016-03-22 12:49:33 -0400
commit21a0e07ffccbee57fa02f20525441f96516132dc (patch)
tree3f827ffa0019f1b437aff48606db0e8172ecc43e /src/leap/bitmask/services/mail/smtpbootstrapper.py
parent3d2df02b549a32c15b2bb369a33789abadb60c92 (diff)
[bug] re-download smtp certificate if needed.
the should_redownload function was only called if the pemfile was not present of the fs. - Resolves: #7869
Diffstat (limited to 'src/leap/bitmask/services/mail/smtpbootstrapper.py')
-rw-r--r--src/leap/bitmask/services/mail/smtpbootstrapper.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/leap/bitmask/services/mail/smtpbootstrapper.py b/src/leap/bitmask/services/mail/smtpbootstrapper.py
index dadf59dd..f73687a7 100644
--- a/src/leap/bitmask/services/mail/smtpbootstrapper.py
+++ b/src/leap/bitmask/services/mail/smtpbootstrapper.py
@@ -29,7 +29,6 @@ from leap.bitmask.logs.utils import get_logger
from leap.bitmask.services import download_service_config
from leap.bitmask.services.abstractbootstrapper import AbstractBootstrapper
from leap.bitmask.services.mail.smtpconfig import SMTPConfig
-from leap.bitmask.util import is_file
from leap.common import certs as leap_certs
from leap.common.check import leap_assert
@@ -93,11 +92,13 @@ class SMTPBootstrapper(AbstractBootstrapper):
client_cert_path = self._smtp_config.get_client_cert_path(
self._userid, self._provider_config, about_to_download=True)
- if not is_file(client_cert_path):
+ needs_download = leap_certs.should_redownload(client_cert_path)
+
+ if needs_download:
# For re-download if something is wrong with the cert
+ # FIXME this doesn't read well. should reword the logic here.
self._download_if_needed = (
- self._download_if_needed and
- not leap_certs.should_redownload(client_cert_path))
+ self._download_if_needed and not needs_download)
if self._download_if_needed and os.path.isfile(client_cert_path):
check_and_fix_urw_only(client_cert_path)