Merge pull request #2815 from alwaysjolley/cleanup_chain
Cleanup no chain in Vault destination plugin
This commit is contained in:
commit
3434f78e50
|
@ -259,16 +259,21 @@ class VaultDestinationPlugin(DestinationPlugin):
|
||||||
secret = get_secret(client, mount, path)
|
secret = get_secret(client, mount, path)
|
||||||
secret["data"][cname] = {}
|
secret["data"][cname] = {}
|
||||||
|
|
||||||
|
if not cert_chain:
|
||||||
|
chain = ''
|
||||||
|
else:
|
||||||
|
chain = cert_chain
|
||||||
|
|
||||||
if bundle == "Nginx":
|
if bundle == "Nginx":
|
||||||
secret["data"][cname]["crt"] = "{0}\n{1}".format(body, cert_chain)
|
secret["data"][cname]["crt"] = "{0}\n{1}".format(body, chain)
|
||||||
secret["data"][cname]["key"] = private_key
|
secret["data"][cname]["key"] = private_key
|
||||||
elif bundle == "Apache":
|
elif bundle == "Apache":
|
||||||
secret["data"][cname]["crt"] = body
|
secret["data"][cname]["crt"] = body
|
||||||
secret["data"][cname]["chain"] = cert_chain
|
secret["data"][cname]["chain"] = chain
|
||||||
secret["data"][cname]["key"] = private_key
|
secret["data"][cname]["key"] = private_key
|
||||||
elif bundle == "PEM":
|
elif bundle == "PEM":
|
||||||
secret["data"][cname]["pem"] = "{0}\n{1}\n{2}".format(
|
secret["data"][cname]["pem"] = "{0}\n{1}\n{2}".format(
|
||||||
body, cert_chain, private_key
|
body, chain, private_key
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
secret["data"][cname]["crt"] = body
|
secret["data"][cname]["crt"] = body
|
||||||
|
|
Loading…
Reference in New Issue