Skip to content

Commit

Permalink
Improve message error for subsystem certificate not found
Browse files Browse the repository at this point in the history
  • Loading branch information
fmarco76 committed Oct 9, 2023
1 parent 6075e73 commit c89c3c2
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions base/ca/src/main/java/com/netscape/ca/CertificateAuthority.java
Original file line number Diff line number Diff line change
Expand Up @@ -1036,10 +1036,13 @@ public X509CertImpl getCACert() throws EBaseException {
return caCertImpl;
}

String certnickname = mConfig.getString("signing.certnickname");
String tokennickname = mConfig.getString("signing.tokenname");
String certName = mConfig.getString("signing.certnickname");
String tokenName = mConfig.getString("signing.tokenname");

if(!CryptoUtil.isInternalToken(tokenName)) {
certName = tokenName + ":" + certName;
}

String certName = tokennickname + ":" + certnickname;
logger.debug("CertificateAuthority: Getting CA signing cert: " + certName);

CryptoManager manager;
Expand All @@ -1048,8 +1051,8 @@ public X509CertImpl getCACert() throws EBaseException {
manager= CryptoManager.getInstance();
caCert = manager.findCertByNickname(certName);
} catch (ObjectNotFoundException | NotInitializedException | TokenException e) {
logger.error("CertificateAuthority: Missing CA signing certificate");
throw new EBaseException("Missing CA signing certificate", e);
logger.error("CertificateAuthority: Unable to find CA signing certificate: " + e.getMessage(), e);
throw new EBaseException("Unable to find CA signing certificate: " + e.getMessage(), e);
}

try {
Expand Down

0 comments on commit c89c3c2

Please sign in to comment.