summaryrefslogtreecommitdiffstats
path: root/ipapython
diff options
context:
space:
mode:
authorJan Cholasta <jcholast@redhat.com>2014-10-08 10:27:25 +0200
committerPetr Vobornik <pvoborni@redhat.com>2014-10-16 19:11:52 +0200
commit4333a623da4190a7e59e7397159e8200d131904b (patch)
tree448764f82a4acd3b3cb205df4491d3e0304a7901 /ipapython
parentfdc70e89e9fa83b45ef403eda401c0c85f205480 (diff)
downloadfreeipa-4333a623da4190a7e59e7397159e8200d131904b.tar.gz
freeipa-4333a623da4190a7e59e7397159e8200d131904b.tar.xz
freeipa-4333a623da4190a7e59e7397159e8200d131904b.zip
Fix certmonger.request_cert
https://fedorahosted.org/freeipa/ticket/4550 Reviewed-By: Petr Vobornik <pvoborni@redhat.com>
Diffstat (limited to 'ipapython')
-rw-r--r--ipapython/certmonger.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/ipapython/certmonger.py b/ipapython/certmonger.py
index dc6cff966..ac095f070 100644
--- a/ipapython/certmonger.py
+++ b/ipapython/certmonger.py
@@ -254,9 +254,14 @@ def request_cert(nssdb, nickname, subject, principal, passwd_fname=None):
Execute certmonger to request a server certificate.
"""
cm = _connect_to_certmonger()
+ ca_path = cm.obj_if.find_ca_by_nickname('IPA')
+ if not ca_path:
+ raise RuntimeError('IPA CA not found')
request_parameters = dict(KEY_STORAGE='NSSDB', CERT_STORAGE='NSSDB',
CERT_LOCATION=nssdb, CERT_NICKNAME=nickname,
- SUBJECT=subject, PRINCIPAL=principal,)
+ KEY_LOCATION=nssdb, KEY_NICKNAME=nickname,
+ SUBJECT=subject, PRINCIPAL=[principal],
+ CA=ca_path)
if passwd_fname:
request_parameters['KEY_PIN_FILE'] = passwd_fname
result = cm.obj_if.add_request(request_parameters)