diff options
author | Bruno Wagner Goncalves <bwagner@thoughtworks.com> | 2014-08-20 15:43:50 -0300 |
---|---|---|
committer | Bruno Wagner Goncalves <bwagner@thoughtworks.com> | 2014-08-20 18:27:01 -0300 |
commit | 31289cb156540a95dfe51737d9fd4e1a7393f2f2 (patch) | |
tree | 238480ca562c9c65e1aeaaeaebe063549b3718f4 /service/app/bitmask_libraries/certs.py | |
parent | 02df978f9faa4a00b07d2c70d3bd47a25287d0e1 (diff) |
Added setup.py and changed app to pixelated because it will be a package
Diffstat (limited to 'service/app/bitmask_libraries/certs.py')
-rw-r--r-- | service/app/bitmask_libraries/certs.py | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/service/app/bitmask_libraries/certs.py b/service/app/bitmask_libraries/certs.py deleted file mode 100644 index 22a95591..00000000 --- a/service/app/bitmask_libraries/certs.py +++ /dev/null @@ -1,33 +0,0 @@ -import os - -from leap.common import ca_bundle - -from .config import AUTO_DETECT_CA_BUNDLE - - -def which_bundle(provider): - return LeapCertificate(provider).auto_detect_ca_bundle() - - -class LeapCertificate(object): - def __init__(self, provider): - self._config = provider.config - self._server_name = provider.server_name - self._certs_home = self._config.certs_home - - def auto_detect_ca_bundle(self): - if self._config.ca_cert_bundle == AUTO_DETECT_CA_BUNDLE: - local_cert = self._local_server_cert() - if local_cert: - return local_cert - else: - return ca_bundle.where() - else: - return self._config.ca_cert_bundle - - def _local_server_cert(self): - cert_file = os.path.join(self._certs_home, '%s.ca.crt' % self._server_name) - if os.path.isfile(cert_file): - return cert_file - else: - return None |