Skip to content
Snippets Groups Projects
Commit 1df46520 authored by Philippe Larose's avatar Philippe Larose
Browse files

jams-server: prevent server start if CA failed to load

If the config.json file is corrupted, JAMS may start even though its CA
is null. In this state, the server cannot authenticate any user and is
not operational.

Ticket: https://redmine.savoirfairelinux.com/issues/7668
Change-Id: I61e69200af1089a085991176fa6bb6273ecc2e82
parent a7a5933b
No related branches found
No related tags found
No related merge requests found
......@@ -168,6 +168,10 @@ public class Server {
certificateAuthority =
CryptoEngineLoader.loadCertificateAuthority(
serverSettings.getCaConfiguration(), dataStore);
if (certificateAuthority == null) {
log.error("Could not load certificate authority - this is critical");
System.exit(1);
}
userAuthenticationModule =
AuthModuleLoader.loadAuthenticationModule(dataStore, certificateAuthority);
......
......@@ -51,7 +51,7 @@ public class CryptoEngineLoader {
"Loaded X509 Engine - please make sure it is initialized before using it to sign requests!");
return certificateAuthority;
} catch (Exception e) {
log.error("Unable to load X509 Engine!");
log.error("Load X509 Engine failed with error:", e);
return null;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment