Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ISPN-6922 Support for loading keystores from classpath in the Hot Rod…
… client
- Loading branch information
Showing
4 changed files
with
52 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
...c/test/java/org/infinispan/client/hotrod/configuration/SSLClassPathConfigurationTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package org.infinispan.client.hotrod.configuration; | ||
|
||
|
||
import org.infinispan.commons.util.SslContextFactory; | ||
import static org.testng.Assert.assertNotNull; | ||
import org.testng.annotations.Test; | ||
|
||
import javax.net.ssl.SSLContext; | ||
|
||
@Test(testName = "client.hotrod.configuration.SSLClassPathConfigurationTest", groups = "functional") | ||
public class SSLClassPathConfigurationTest { | ||
|
||
public void testLoadTrustStore() { | ||
String keyStoreFileName = getClass().getResource("/keystore.jks").getPath(); | ||
String truststoreFileName = "classpath:truststore2.jks"; | ||
char[] password = "secret".toCharArray(); | ||
|
||
SSLContext context = | ||
SslContextFactory.getContext(keyStoreFileName, password, truststoreFileName, password); | ||
|
||
assertNotNull(context); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters