X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;f=org.argeo.cms%2Fsrc%2Forg%2Fargeo%2Fcms%2Finternal%2Fruntime%2FCmsStateImpl.java;h=4d1d698453015bd0e2f82e122b6899ec0a84f1e9;hb=4086635cfaa04c8a184124048794398b0ba96a55;hp=c1f92deb40b3ea7743098bcb0c8e4bbdacc028af;hpb=a4e2def61f587de89a03037aec2b95c54732ec55;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 c1f92deb4..4d1d69845 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 @@ -23,6 +23,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; @@ -152,6 +153,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 +197,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 +248,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() { @@ -373,6 +382,11 @@ public class CmsStateImpl implements CmsState { return KernelUtils.getOsgiInstancePath(relativePath); } + @Override + public Path getStatePath(String relativePath) { + return KernelUtils.getOsgiConfigurationPath(relativePath); + } + @Override public Long getAvailableSince() { return availableSince;