|
|
|
|
@ -54,10 +54,28 @@ public class DfxAgentApplication {
|
|
|
|
|
props.put("server.port", agentConfigDto.getMyListenPort());
|
|
|
|
|
props.put("server.ssl.enabled", agentConfigDto.isSslEnabled());
|
|
|
|
|
props.put("server.ssl.key-store", agentConfigDto.getKeyStorePath());
|
|
|
|
|
String keyStoreFilePath = agentConfigDto.getKeyStorePath();
|
|
|
|
|
if(keyStoreFilePath.startsWith("file:")) {
|
|
|
|
|
keyStoreFilePath = keyStoreFilePath.substring(5);
|
|
|
|
|
}
|
|
|
|
|
File keyStoreFile = new File(keyStoreFilePath);
|
|
|
|
|
if(!keyStoreFile.exists()) {
|
|
|
|
|
System.out.println("cannot find a keystore file: " + keyStoreFilePath);
|
|
|
|
|
System.exit(0);
|
|
|
|
|
}
|
|
|
|
|
props.put("server.ssl.key-store-password", agentConfigDto.getKeyStorePassword());
|
|
|
|
|
props.put("server.ssl.key-alias", agentConfigDto.getKeyStoreAlias());
|
|
|
|
|
props.put("server.ssl.key-store-type", "PKCS12");
|
|
|
|
|
props.put("server.ssl.trust-store", agentConfigDto.getTrustStorePath());
|
|
|
|
|
String trustStoreFilePath = agentConfigDto.getTrustStorePath();
|
|
|
|
|
if(trustStoreFilePath.startsWith("file:")) {
|
|
|
|
|
trustStoreFilePath = trustStoreFilePath.substring(5);
|
|
|
|
|
}
|
|
|
|
|
File trustStoreFile = new File(trustStoreFilePath);
|
|
|
|
|
if(!trustStoreFile.exists()) {
|
|
|
|
|
System.out.println("cannot find a truststore file: " + trustStoreFilePath);
|
|
|
|
|
System.exit(0);
|
|
|
|
|
}
|
|
|
|
|
props.put("server.ssl.trust-store-password", agentConfigDto.getTrustStorePassword());
|
|
|
|
|
props.put("server.ssl.trust-store-type", "JKS");
|
|
|
|
|
props.put("server.ssl.client-auth", "need");
|
|
|
|
|
|