Skip to content

Commit

Permalink
Update PKIDeployer.setup_system_cert()
Browse files Browse the repository at this point in the history
The PKIDeployer.setup_system_cert() has been modified to
reuse the existing system certs if they already exist in
the NSS database.
  • Loading branch information
edewata committed Nov 8, 2023
1 parent c0fd0a7 commit 3700a59
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions base/server/python/pki/server/deployment/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3141,7 +3141,7 @@ def setup_system_cert(self, nssdb, subsystem, tag, system_cert, request):

# For external/existing CA case, the requests and certs might be provided
# (i.e. already exists in NSS database), but they still need to be imported
# into internal database.
# into CA database.
#
# A new SSL server cert will always be created separately later.

Expand Down Expand Up @@ -3241,10 +3241,8 @@ def setup_system_cert(self, nssdb, subsystem, tag, system_cert, request):
subsystem.update_system_cert(system_cert)

if cert_info:
logger.info('Remove existing %s cert from NSS database but keep the key', tag)
nssdb.remove_cert(
nickname=request.systemCert.nickname,
token=request.systemCert.token)
logger.info('Reusing existing %s cert in NSS database', tag)
return

logger.info('Importing %s cert into NSS database', tag)
nssdb.add_cert(
Expand Down

0 comments on commit 3700a59

Please sign in to comment.