You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by sp...@apache.org on 2020/02/26 20:36:58 UTC
[tinkerpop] 03/05: Merge branch '3.3-dev' into 3.4-dev
This is an automated email from the ASF dual-hosted git repository.
spmallette pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git
commit 6d329aeb03fc353b36f00d775fd9c4c869acbfdc
Merge: b4fd63e 616862d
Author: Stephen Mallette <sp...@genoprime.com>
AuthorDate: Wed Feb 26 14:24:33 2020 -0500
Merge branch '3.3-dev' into 3.4-dev
CHANGELOG.asciidoc | 1 +
.../apache/tinkerpop/gremlin/driver/Cluster.java | 17 ++++-
.../apache/tinkerpop/gremlin/driver/Settings.java | 9 +++
.../tinkerpop/gremlin/driver/SettingsTest.java | 2 +
.../gremlin/server/AbstractChannelizer.java | 6 +-
.../apache/tinkerpop/gremlin/server/Settings.java | 5 ++
.../AbstractGremlinServerIntegrationTest.java | 2 +
.../gremlin/server/GremlinServerIntegrateTest.java | 80 ++++++++++++++++++++++
8 files changed, 117 insertions(+), 5 deletions(-)
diff --cc gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java
index 4212fac,09056c2..7cb785e
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java
@@@ -1189,7 -1514,72 +1204,72 @@@ public class GremlinServerIntegrateTes
client.submit(script, b).all().get();
fail("Should have tanked out because of number of parameters used and size of the compile script");
} catch (Exception ex) {
- assertThat(ex.getMessage(), containsString("The Gremlin statement that was submitted exceed the maximum compilation size allowed by the JVM"));
+ assertThat(ex.getMessage(), containsString("The Gremlin statement that was submitted exceeds the maximum compilation size allowed by the JVM"));
}
}
+
+ @Test
+ public void shouldEnableSslAndClientCertificateAuthWithDifferentStoreType() {
+ final Cluster cluster = TestClientFactory.build().enableSsl(true)
+ .keyStore(JKS_CLIENT_KEY).keyStorePassword(KEY_PASS).keyStoreType(KEYSTORE_TYPE_JKS)
+ .trustStore(P12_CLIENT_TRUST).trustStorePassword(KEY_PASS).trustStoreType(TRUSTSTORE_TYPE_PKCS12)
+ .create();
+ final Client client = cluster.connect();
+
+ try {
+ assertEquals("test", client.submit("'test'").one().getString());
+ } finally {
+ cluster.close();
+ }
+
+ final Cluster cluster2 = TestClientFactory.build().enableSsl(true)
+ .keyStore(P12_CLIENT_KEY).keyStorePassword(KEY_PASS).keyStoreType(KEYSTORE_TYPE_PKCS12)
+ .trustStore(JKS_CLIENT_TRUST).trustStorePassword(KEY_PASS).trustStoreType(TRUSTSTORE_TYPE_JKS)
+ .create();
+ final Client client2 = cluster2.connect();
+
+ try {
+ assertEquals("test", client2.submit("'test'").one().getString());
+ } finally {
+ cluster2.close();
+ }
+ }
+
+ @Test
+ public void shouldEnableSslAndClientCertificateAuthAndFailWithIncorrectKeyStoreType() {
+ final Cluster cluster = TestClientFactory.build().enableSsl(true)
+ .keyStore(JKS_CLIENT_KEY).keyStorePassword(KEY_PASS).keyStoreType(KEYSTORE_TYPE_PKCS12)
+ .trustStore(P12_CLIENT_TRUST).trustStorePassword(KEY_PASS).trustStoreType(TRUSTSTORE_TYPE_PKCS12)
+ .create();
+ final Client client = cluster.connect();
+
+ try {
+ String res = client.submit("'test'").one().getString();
+ fail("Should throw exception because incorrect keyStoreType is specified");
+ } catch (Exception x) {
+ final Throwable root = ExceptionUtils.getRootCause(x);
+ assertThat(root, instanceOf(TimeoutException.class));
+ } finally {
+ cluster.close();
+ }
+ }
+
+ @Test
+ public void shouldEnableSslAndClientCertificateAuthAndFailWithIncorrectTrustStoreType() {
+ final Cluster cluster = TestClientFactory.build().enableSsl(true)
+ .keyStore(P12_CLIENT_KEY).keyStorePassword(KEY_PASS).keyStoreType(KEYSTORE_TYPE_PKCS12)
+ .trustStore(JKS_CLIENT_TRUST).trustStorePassword(KEY_PASS).trustStoreType(TRUSTSTORE_TYPE_PKCS12)
+ .create();
+ final Client client = cluster.connect();
+
+ try {
+ client.submit("'test'").one();
+ fail("Should throw exception because incorrect trustStoreType is specified");
+ } catch (Exception x) {
+ final Throwable root = ExceptionUtils.getRootCause(x);
+ assertThat(root, instanceOf(TimeoutException.class));
+ } finally {
+ cluster.close();
+ }
+ }
}