Skip to content

Commit

Permalink
Making certfile/keyfile optional, so that vnc_api can rely on CA or C…
Browse files Browse the repository at this point in the history
…A/CERT.

Change-Id: Iffb9bf9d8cf23fe3943335565bf2adaf878c5df8
Partial-Bug: 1630513
  • Loading branch information
cijohnson committed Oct 19, 2016
1 parent 93c8322 commit 093321a
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions src/api-lib/vnc_api.py
Expand Up @@ -222,9 +222,15 @@ def __init__(self, username=None, password=None, tenant_name=None,
apicafile=_read_cfg(cfg_parser,'global','cafile','')

self._use_api_certs=False
if apicertfile and apikeyfile \
and apicafile and api_server_use_ssl:
certs=[apicertfile, apikeyfile, apicafile]
if api_server_use_ssl:
certs = []
if apicafile:
certs.append(apicafile)
if apicertfile:
certs.append(apicertfile)
if apikeyfile:
certs.append(apikeyfile)
if certs:
self._apicertbundle=utils.getCertKeyCaBundle(VncApi._DEFAULT_API_CERT_BUNDLE,certs)
self._use_api_certs=True

Expand All @@ -240,9 +246,15 @@ def __init__(self, username=None, password=None, tenant_name=None,
kscafile=_read_cfg(cfg_parser,'auth','cafile','')

self._use_ks_certs=False
if kscertfile and kskeyfile and kscafile \
and self._authn_protocol == 'https':
certs=[kscertfile, kskeyfile, kscafile]
if self._authn_protocol == 'https':
certs = []
if kscafile:
certs.append(kscafile)
if kscertfile:
certs.append(kscertfile)
if kskeytfile:
certs.append(kskeyfile)
if certs:
self._kscertbundle=utils.getCertKeyCaBundle(VncApi._DEFAULT_KS_CERT_BUNDLE,certs)
self._use_ks_certs=True

Expand Down

0 comments on commit 093321a

Please sign in to comment.