diff options
author | Tomás Touceda <chiiph@leap.se> | 2013-03-13 13:39:00 -0300 |
---|---|---|
committer | Tomás Touceda <chiiph@leap.se> | 2013-03-13 13:39:00 -0300 |
commit | 4359515dafe572398262ce91bf88d4f122042981 (patch) | |
tree | 19ec18db21123fac8d93de95b30946cf5526524a /src/leap/util/certs.py | |
parent | ebb2d8c1a01e5273d84273fd5dc3bf735be34fa2 (diff) |
Add vpn already running checks
Diffstat (limited to 'src/leap/util/certs.py')
-rw-r--r-- | src/leap/util/certs.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/leap/util/certs.py b/src/leap/util/certs.py index a8bcd65e..63c60c3d 100644 --- a/src/leap/util/certs.py +++ b/src/leap/util/certs.py @@ -162,14 +162,16 @@ def should_redownload(certfile, now=time.gmtime): if not exists: return True + certdata = None try: with open(certfile, "r") as f: - if not is_valid_pemfile(f.read()): + certdata = f.read() + if not is_valid_pemfile(certdata): return True except: return True - valid_from, valid_to = get_cert_time_boundaries(certfile) + valid_from, valid_to = get_cert_time_boundaries(certdata) if not (valid_from < now() < valid_to): return True |