From 03c708ccc96415458d814c4fa4bb2a4aff7f2bd9 Mon Sep 17 00:00:00 2001 From: Laurent Cohen Date: Sun, 7 Jul 2019 00:21:48 +0200 Subject: [PATCH] SSL config files can now use includes, value substitutions, acripting --- common/src/java/org/jppf/ssl/SSLHelper.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/common/src/java/org/jppf/ssl/SSLHelper.java b/common/src/java/org/jppf/ssl/SSLHelper.java index f27e77728d..3ce9384d73 100644 --- a/common/src/java/org/jppf/ssl/SSLHelper.java +++ b/common/src/java/org/jppf/ssl/SSLHelper.java @@ -20,8 +20,9 @@ import static org.jppf.jmx.JPPFJMXProperties.*; -import java.io.InputStream; +import java.io.*; import java.net.Socket; +import java.nio.charset.StandardCharsets; import java.util.Map; import javax.net.ssl.*; @@ -30,7 +31,6 @@ import org.jppf.jmx.JMXEnvHelper; import org.jppf.utils.*; import org.jppf.utils.configuration.*; -import org.jppf.utils.streams.StreamUtils; import org.slf4j.*; /** @@ -127,12 +127,10 @@ private static void loadSSLProperties() throws Exception { is = FileUtils.getFileInputStream(source); } if (is == null) throw new SSLConfigurationException("could not load the SSL configuration '" + source + "'"); - try { - sslConfig.load(is); + try (final InputStreamReader reader = new InputStreamReader(is, StandardCharsets.ISO_8859_1)) { + sslConfig.loadAndResolve(reader); helper = new SSLHelper2(sslConfig); if (debugEnabled) log.debug("successfully loaded the SSL configuration from '{}'", source); - } finally { - StreamUtils.closeSilent(is); } } }