summaryrefslogtreecommitdiffstats
path: root/base/server/python/pki/server/deployment/scriptlets/security_databases.py
diff options
context:
space:
mode:
authorEndi S. Dewata <edewata@redhat.com>2016-03-17 15:23:34 +0100
committerEndi S. Dewata <edewata@redhat.com>2016-03-18 22:29:26 +0100
commitc14e8c52ae7a2c15433fe9568c393c1d0e7a1301 (patch)
treea9611500f648015bb92ae29546d633e86a95e112 /base/server/python/pki/server/deployment/scriptlets/security_databases.py
parent04055a9bc40486950a3288acf610522e767c1e27 (diff)
downloadpki-c14e8c52ae7a2c15433fe9568c393c1d0e7a1301.tar.gz
pki-c14e8c52ae7a2c15433fe9568c393c1d0e7a1301.tar.xz
pki-c14e8c52ae7a2c15433fe9568c393c1d0e7a1301.zip
Added support for cloning 3rd-party CA certificates.
The installation code has been modified such that it imports all CA certificates from the PKCS #12 file for cloning before the server is started using certutil. The user certificates will continue to be imported using the existing JSS code after the server is started. This is necessary since JSS is unable to preserve the CA certificate nicknames. The PKCS12Util has been modified to support multiple certificates with the same nicknames. The pki pkcs12-cert-find has been modified to show certificate ID and another field indicating whether the certificate has a key. The pki pkcs12-cert-export has been modified to accept either certificate nickname or ID. The pki pkcs12-import has been modified to provide options for importing only user certificates or CA certificates. https://fedorahosted.org/pki/ticket/1742
Diffstat (limited to 'base/server/python/pki/server/deployment/scriptlets/security_databases.py')
-rw-r--r--base/server/python/pki/server/deployment/scriptlets/security_databases.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/base/server/python/pki/server/deployment/scriptlets/security_databases.py b/base/server/python/pki/server/deployment/scriptlets/security_databases.py
index 3947ad64c..a567b7cdf 100644
--- a/base/server/python/pki/server/deployment/scriptlets/security_databases.py
+++ b/base/server/python/pki/server/deployment/scriptlets/security_databases.py
@@ -108,6 +108,25 @@ class PkiScriptlet(pkiscriptlet.AbstractBasePkiScriptlet):
if external_certs_path is not None:
self.update_external_certs_conf(external_certs_path, deployer)
+ # import CA certificates from PKCS #12 file for cloning
+ pki_clone_pkcs12_path = deployer.mdict['pki_clone_pkcs12_path']
+
+ if pki_clone_pkcs12_path:
+
+ pki_clone_pkcs12_password = deployer.mdict[
+ 'pki_clone_pkcs12_password']
+ if not pki_clone_pkcs12_password:
+ raise Exception('Missing pki_clone_pkcs12_password property.')
+
+ nssdb = pki.nssdb.NSSDatabase(
+ directory=deployer.mdict['pki_database_path'],
+ password_file=deployer.mdict['pki_shared_pfile'])
+
+ nssdb.import_pkcs12(
+ pkcs12_file=pki_clone_pkcs12_path,
+ pkcs12_password=pki_clone_pkcs12_password,
+ no_user_certs=True)
+
if len(deployer.instance.tomcat_instance_subsystems()) < 2:
# only create a self signed cert for a new instance
#