summaryrefslogtreecommitdiff
path: root/src/leap/eip/checks.py
diff options
context:
space:
mode:
authorkali <kali@leap.se>2012-12-18 21:07:06 +0900
committerkali <kali@leap.se>2012-12-18 21:07:06 +0900
commit20f779b644a551bf56cb735868c55cd50d7c3610 (patch)
treeb5de98d648d84e8d1449a500e8c9c702ee0ef519 /src/leap/eip/checks.py
parent8808c0e2cba1660515fab4a2931221c3bda7e093 (diff)
catch gnutls error while validating pemfile
Diffstat (limited to 'src/leap/eip/checks.py')
-rw-r--r--src/leap/eip/checks.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/leap/eip/checks.py b/src/leap/eip/checks.py
index 4afba8b6..65596d1c 100644
--- a/src/leap/eip/checks.py
+++ b/src/leap/eip/checks.py
@@ -293,7 +293,11 @@ class ProviderCertChecker(object):
certfile = self._get_client_cert_path()
with open(certfile) as cf:
cert_s = cf.read()
- valid = certs.can_load_cert_and_pkey(cert_s)
+ try:
+ valid = certs.can_load_cert_and_pkey(cert_s)
+ except certs.BadCertError:
+ logger.warning("Not valid pemfile")
+ valid = False
return valid
@property