summaryrefslogtreecommitdiff
path: root/src/leap/util/certs.py
diff options
context:
space:
mode:
authorTomás Touceda <chiiph@leap.se>2013-03-13 13:39:00 -0300
committerTomás Touceda <chiiph@leap.se>2013-03-13 13:39:00 -0300
commit4359515dafe572398262ce91bf88d4f122042981 (patch)
tree19ec18db21123fac8d93de95b30946cf5526524a /src/leap/util/certs.py
parentebb2d8c1a01e5273d84273fd5dc3bf735be34fa2 (diff)
Add vpn already running checks
Diffstat (limited to 'src/leap/util/certs.py')
-rw-r--r--src/leap/util/certs.py6
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