|
|
|
@ -53,30 +53,29 @@ public class DfxAgentApplication {
|
|
|
|
if(agentConfigDto.isSslEnabled()) {
|
|
|
|
if(agentConfigDto.isSslEnabled()) {
|
|
|
|
props.put("server.port", agentConfigDto.getMyListenPort());
|
|
|
|
props.put("server.port", agentConfigDto.getMyListenPort());
|
|
|
|
props.put("server.ssl.enabled", agentConfigDto.isSslEnabled());
|
|
|
|
props.put("server.ssl.enabled", agentConfigDto.isSslEnabled());
|
|
|
|
props.put("server.ssl.key-store", agentConfigDto.getKeyStorePath());
|
|
|
|
props.put("server.ssl.key-store", System.getProperty("javax.net.ssl.keyStore"));
|
|
|
|
String keyStoreFilePath = agentConfigDto.getKeyStorePath();
|
|
|
|
String keyStoreFilePath = String.valueOf(props.get("server.ssl.key-store"));
|
|
|
|
if(keyStoreFilePath.startsWith("file:")) {
|
|
|
|
if(keyStoreFilePath.startsWith("file:/")) {
|
|
|
|
keyStoreFilePath = keyStoreFilePath.substring(5);
|
|
|
|
keyStoreFilePath = keyStoreFilePath.substring(6);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
File keyStoreFile = new File(keyStoreFilePath);
|
|
|
|
File keyStoreFile = new File(keyStoreFilePath);
|
|
|
|
if(!keyStoreFile.exists()) {
|
|
|
|
if(!keyStoreFile.exists()) {
|
|
|
|
System.out.println("cannot find a keystore file: " + keyStoreFilePath);
|
|
|
|
System.out.println("cannot find a keystore file: " + keyStoreFilePath);
|
|
|
|
System.exit(0);
|
|
|
|
System.exit(0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
props.put("server.ssl.key-store-password", agentConfigDto.getKeyStorePassword());
|
|
|
|
props.put("server.ssl.key-store-password", System.getProperty("javax.net.ssl.keyStorePassword"));
|
|
|
|
props.put("server.ssl.key-alias", agentConfigDto.getKeyStoreAlias());
|
|
|
|
props.put("server.ssl.key-store-type", System.getProperty("javax.net.ssl.keyStoreType"));
|
|
|
|
props.put("server.ssl.key-store-type", "PKCS12");
|
|
|
|
props.put("server.ssl.trust-store", System.getProperty("javax.net.ssl.trustStore"));
|
|
|
|
props.put("server.ssl.trust-store", agentConfigDto.getTrustStorePath());
|
|
|
|
String trustStoreFilePath = String.valueOf(props.get("server.ssl.trust-store"));
|
|
|
|
String trustStoreFilePath = agentConfigDto.getTrustStorePath();
|
|
|
|
if(trustStoreFilePath.startsWith("file:/")) {
|
|
|
|
if(trustStoreFilePath.startsWith("file:")) {
|
|
|
|
trustStoreFilePath = trustStoreFilePath.substring(6);
|
|
|
|
trustStoreFilePath = trustStoreFilePath.substring(5);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
File trustStoreFile = new File(trustStoreFilePath);
|
|
|
|
File trustStoreFile = new File(trustStoreFilePath);
|
|
|
|
if(!trustStoreFile.exists()) {
|
|
|
|
if(!trustStoreFile.exists()) {
|
|
|
|
System.out.println("cannot find a truststore file: " + trustStoreFilePath);
|
|
|
|
System.out.println("cannot find a truststore file: " + trustStoreFilePath);
|
|
|
|
System.exit(0);
|
|
|
|
System.exit(0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
props.put("server.ssl.trust-store-password", agentConfigDto.getTrustStorePassword());
|
|
|
|
props.put("server.ssl.trust-store-password", System.getProperty("javax.net.ssl.trustStorePassword"));
|
|
|
|
props.put("server.ssl.trust-store-type", "JKS");
|
|
|
|
props.put("server.ssl.trust-store-type", "JKS");
|
|
|
|
props.put("server.ssl.client-auth", "need");
|
|
|
|
props.put("server.ssl.client-auth", "need");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|