This commit is contained in:
Ryan Ernst 2017-01-06 09:11:07 -08:00
parent eb596d7270
commit 42ebfe7bdb
1 changed files with 6 additions and 4 deletions

View File

@ -242,15 +242,17 @@ final class Bootstrap {
return keystore; return keystore;
} }
private static Environment initialEnvironment(boolean foreground, Path pidFile, private static Environment createEnvironment(boolean foreground, Path pidFile,
KeyStoreWrapper keystore, Settings initialSettings) { KeyStoreWrapper keystore, Settings initialSettings) {
Terminal terminal = foreground ? Terminal.DEFAULT : null; Terminal terminal = foreground ? Terminal.DEFAULT : null;
Settings.Builder builder = Settings.builder(); Settings.Builder builder = Settings.builder();
if (pidFile != null) { if (pidFile != null) {
builder.put(Environment.PIDFILE_SETTING.getKey(), pidFile); builder.put(Environment.PIDFILE_SETTING.getKey(), pidFile);
} }
builder.put(initialSettings); builder.put(initialSettings);
builder.setKeyStore(keystore); if (keystore != null) {
builder.setKeyStore(keystore);
}
return InternalSettingsPreparer.prepareEnvironment(builder.build(), terminal, Collections.emptyMap()); return InternalSettingsPreparer.prepareEnvironment(builder.build(), terminal, Collections.emptyMap());
} }
@ -292,7 +294,7 @@ final class Bootstrap {
INSTANCE = new Bootstrap(); INSTANCE = new Bootstrap();
final KeyStoreWrapper keystore = loadKeyStore(initialEnv); final KeyStoreWrapper keystore = loadKeyStore(initialEnv);
Environment environment = initialEnvironment(foreground, pidFile, keystore, initialEnv.settings()); Environment environment = createEnvironment(foreground, pidFile, keystore, initialEnv.settings());
try { try {
LogConfigurator.configure(environment); LogConfigurator.configure(environment);
} catch (IOException e) { } catch (IOException e) {