X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=org.argeo.cms%2Fsrc%2Forg%2Fargeo%2Fcms%2Finternal%2Fruntime%2FCmsStateImpl.java;h=60a51b44f7f8a8f913f8008e11460b2a956114f1;hb=55d88fba80cec198a0f11ba7545e19878c51fc5e;hp=5dc8570099c608bae621e50b43b4f838e9ea092c;hpb=2c5da70747629282585d5515720dcb1515a0011c;p=lgpl%2Fargeo-commons.git diff --git a/org.argeo.cms/src/org/argeo/cms/internal/runtime/CmsStateImpl.java b/org.argeo.cms/src/org/argeo/cms/internal/runtime/CmsStateImpl.java index 5dc857009..60a51b44f 100644 --- a/org.argeo.cms/src/org/argeo/cms/internal/runtime/CmsStateImpl.java +++ b/org.argeo.cms/src/org/argeo/cms/internal/runtime/CmsStateImpl.java @@ -6,6 +6,7 @@ import java.io.Reader; import java.net.InetAddress; import java.net.URL; import java.net.UnknownHostException; +import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; @@ -23,6 +24,7 @@ import java.util.Map; import java.util.Objects; import java.util.Set; import java.util.StringJoiner; +import java.util.TreeMap; import java.util.UUID; import java.util.concurrent.ExecutionException; import java.util.concurrent.ForkJoinPool; @@ -92,6 +94,9 @@ public class CmsStateImpl implements CmsState { } public void start() { + Charset defaultCharset = Charset.defaultCharset(); + if (!StandardCharsets.UTF_8.equals(defaultCharset)) + log.error("Default JVM charset is " + defaultCharset + " and not " + StandardCharsets.UTF_8); try { // First init check Path privateBase = getDataPath(KernelConstants.DIR_PRIVATE); @@ -152,6 +157,16 @@ public class CmsStateImpl implements CmsState { log.debug("## CMS starting... (" + uuid + ")\n" + sb + "\n"); } + if (log.isTraceEnabled()) { + // print system properties + StringJoiner sb = new StringJoiner("\n"); + for (Object key : new TreeMap<>(System.getProperties()).keySet()) { + sb.add(key + "=" + System.getProperty(key.toString())); + } + log.trace("System properties:\n" + sb + "\n"); + + } + } catch (RuntimeException | IOException e) { log.error("## FATAL: CMS state failed", e); } @@ -186,8 +201,9 @@ public class CmsStateImpl implements CmsState { // explicitly load JAAS configuration Configuration.getConfiguration(); - boolean initSsl = getDeployProperty(CmsDeployProperty.HTTPS_PORT) != null; - if (initSsl) { + boolean initCertificates = (getDeployProperty(CmsDeployProperty.HTTPS_PORT) != null) + || (getDeployProperty(CmsDeployProperty.SSHD_PORT) != null); + if (initCertificates) { initCertificates(); } } @@ -236,9 +252,6 @@ public class CmsStateImpl implements CmsState { log.error("Cannot trust CA certificate", e); } } - -// if (!Files.exists(keyStorePath)) -// PkiUtils.createSelfSignedKeyStore(keyStorePath, keyStorePassword, PkiUtils.PKCS12); } public void stop() {