|
@@ -7,6 +7,8 @@ import org.eclipse.milo.opcua.stack.core.util.SelfSignedCertificateBuilder;
|
|
|
import org.eclipse.milo.opcua.stack.core.util.SelfSignedCertificateGenerator;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
+import org.springframework.core.io.ClassPathResource;
|
|
|
+import org.springframework.core.io.Resource;
|
|
|
|
|
|
import java.io.File;
|
|
|
import java.io.IOException;
|
|
@@ -37,7 +39,8 @@ public class KeyStoreLoader {
|
|
|
public KeyStoreLoader getKeyStoreLoader(OpcuaClientConfig opcuaClientConfig) throws Exception {
|
|
|
String certificateAlias = opcuaClientConfig.getCertAlias();
|
|
|
char[] certificateKey = opcuaClientConfig.getCertKeystorePassword().toCharArray();
|
|
|
- String certificateDir = new File(this.getClass().getClassLoader().getResource("").toURI()).getAbsolutePath() + "\\" + opcuaClientConfig.getCertPath();
|
|
|
+
|
|
|
+ String certificateDir = opcuaClientConfig.getCertPath();
|
|
|
if(!FileUtil.exist(certificateDir)){
|
|
|
FileUtil.mkdir(certificateDir);
|
|
|
}
|