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 c164c765fa632717d80cfb2dcb2b80e46ddeaf3d Merge: 8599829 2e89be3 Author: Stephen Mallette <sp...@genoprime.com> AuthorDate: Fri Sep 20 09:15:06 2019 -0400 Merge branch 'tp34' CHANGELOG.asciidoc | 1 + .../server/op/traversal/TraversalOpProcessor.java | 7 +++++ .../gremlin/server/GremlinServerIntegrateTest.java | 32 ++++++++++++++++++++-- 3 files changed, 38 insertions(+), 2 deletions(-) diff --cc gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java index cc9d084,57f13e0..f0304f1 --- 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 @@@ -590,8 -653,56 +618,8 @@@ public class GremlinServerIntegrateTes cluster.close(); } } - + @Test - public void shouldEnableSslAndClientCertificateAuthWithLegacyPem() { - final Cluster cluster = TestClientFactory.build().enableSsl(true) - .keyCertChainFile(PEM_CLIENT_CRT).keyFile(PEM_CLIENT_KEY) - .keyPassword(KEY_PASS).trustCertificateChainFile(PEM_SERVER_CRT).create(); - final Client client = cluster.connect(); - - try { - assertEquals("test", client.submit("'test'").one().getString()); - } finally { - cluster.close(); - } - } - - @Test - public void shouldEnableSslAndClientCertificateAuthAndFailWithoutCertWithLegacyPem() { - final Cluster cluster = TestClientFactory.build().enableSsl(true).keyStore(JKS_SERVER_KEY).keyStorePassword(KEY_PASS).sslSkipCertValidation(true).create(); - final Client client = cluster.connect(); - - try { - client.submit("'test'").one(); - fail("Should throw exception because ssl client auth is enabled on the server but client does not have a cert"); - } catch(Exception x) { - final Throwable root = ExceptionUtils.getRootCause(x); - assertThat(root, instanceOf(NoHostAvailableException.class)); - } finally { - cluster.close(); - } - } - - @Test - public void shouldEnableSslAndClientCertificateAuthAndFailWithoutTrustedClientCertWithLegacyPem() { - final Cluster cluster = TestClientFactory.build().enableSsl(true) - .keyCertChainFile(PEM_CLIENT_CRT).keyFile(PEM_CLIENT_KEY) - .keyPassword(KEY_PASS).trustCertificateChainFile(PEM_SERVER_CRT).create(); - final Client client = cluster.connect(); - - try { - client.submit("'test'").one(); - fail("Should throw exception because ssl client auth is enabled on the server but does not trust client's cert"); - } catch(Exception x) { - final Throwable root = ExceptionUtils.getRootCause(x); - assertThat(root, instanceOf(NoHostAvailableException.class)); - } finally { - cluster.close(); - } - } - - @Test public void shouldEnableSslAndClientCertificateAuthWithPkcs12() { final Cluster cluster = TestClientFactory.build().enableSsl(true).keyStore(P12_CLIENT_KEY).keyStorePassword(KEY_PASS) .keyStoreType(KEYSTORE_TYPE_PKCS12).trustStore(P12_CLIENT_TRUST).trustStorePassword(KEY_PASS).create();