This is an automated email from the ASF dual-hosted git repository.
apkhmv pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/ignite-3.git
The following commit(s) were added to refs/heads/main by this push:
new 10a58e67a2 IGNITE-18938 SSL integration tests fail on Windows (#1742)
10a58e67a2 is described below
commit 10a58e67a2551f8421d9603ccc97d0f6581ec1b2
Author: Vadim Pakhnushev <[email protected]>
AuthorDate: Mon Mar 6 11:56:49 2023 +0300
IGNITE-18938 SSL integration tests fail on Windows (#1742)
---
.../org/apache/ignite/internal/rest/RestNode.java | 25 ++++++++++++++++------
1 file changed, 18 insertions(+), 7 deletions(-)
diff --git
a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/rest/RestNode.java
b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/rest/RestNode.java
index 844ab29ce7..1a955c1154 100644
---
a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/rest/RestNode.java
+++
b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/rest/RestNode.java
@@ -17,7 +17,10 @@
package org.apache.ignite.internal.rest;
+import java.net.URISyntaxException;
+import java.net.URL;
import java.nio.file.Path;
+import java.util.Objects;
import java.util.concurrent.CompletableFuture;
import org.apache.ignite.Ignite;
import org.apache.ignite.IgnitionManager;
@@ -112,9 +115,6 @@ public class RestNode {
}
private String bootstrapCfg() {
- String keyStoreAbsolutPath =
ItRestSslTest.class.getClassLoader().getResource(keyStorePath).getPath();
- String trustStoreAbsolutPath =
ItRestSslTest.class.getClassLoader().getResource(trustStorePath).getPath();
-
return "{\n"
+ " network: {\n"
+ " port: " + networkPort + ",\n"
@@ -130,16 +130,27 @@ public class RestNode {
+ " clientAuth: " + (sslClientAuthEnabled ? "require" :
"none") + ",\n"
+ " port: " + httpsPort + ",\n"
+ " keyStore: {\n"
- + " path: " + keyStoreAbsolutPath + ",\n"
+ + " path: \"" + getResourcePath(keyStorePath) + "\",\n"
+ " password: " + keyStorePassword + "\n"
+ " }, \n"
+ " trustStore: {\n"
- + " type: JKS, "
- + " path: " + trustStoreAbsolutPath + ",\n"
+ + " type: JKS,\n"
+ + " path: \"" + getResourcePath(trustStorePath) +
"\",\n"
+ " password: " + trustStorePassword + "\n"
+ " }\n"
+ " }\n"
- + " }"
+ + " }\n"
+ "}";
}
+
+ private static String getResourcePath(String resource) {
+ try {
+ URL url =
ItRestSslTest.class.getClassLoader().getResource(resource);
+ Objects.requireNonNull(url, "Resource " + resource + " not
found.");
+ Path path = Path.of(url.toURI()); // Properly extract file system
path from the "file:" URL
+ return path.toString().replace("\\", "\\\\"); // Escape
backslashes for the config parser
+ } catch (URISyntaxException e) {
+ throw new RuntimeException(e); // Shouldn't happen since URL is
obtained from the class loader
+ }
+ }
}