use of io.crate.test.utils.ConnectionTest.ProbeResult in project crate by crate.
the class SSLTransportITest method test_nodes_connect_with_ssl.
@Test
public void test_nodes_connect_with_ssl() throws Exception {
execute("select count(*) from sys.nodes");
assertThat(response.rows()[0][0], is(2L));
SslContextProvider sslContextProvider = new SslContextProvider(sslSettings);
SSLContext sslContext = sslContextProvider.jdkSSLContext();
for (var transport : internalCluster().getInstances(Transport.class)) {
var publishAddress = transport.boundAddress().publishAddress();
var address = publishAddress.address();
ProbeResult probeResult = ConnectionTest.probeSSL(sslContext, address);
assertThat(probeResult, is(ProbeResult.SSL_AVAILABLE));
}
}
use of io.crate.test.utils.ConnectionTest.ProbeResult in project crate by crate.
the class DefaultTransportITest method test_nodes_connect_with_hba_enabled_and_default_transport_mode.
@Test
public void test_nodes_connect_with_hba_enabled_and_default_transport_mode() throws Exception {
execute("select count(*) from sys.nodes");
assertThat(response.rows()[0][0], is(2L));
SslContextProvider sslContextProvider = new SslContextProvider(sslSettings);
SSLContext sslContext = sslContextProvider.jdkSSLContext();
for (var transport : internalCluster().getInstances(Transport.class)) {
var publishAddress = transport.boundAddress().publishAddress();
var address = publishAddress.address();
ProbeResult probeResult = ConnectionTest.probeSSL(sslContext, address);
assertThat(probeResult, is(ProbeResult.SSL_MISSING));
}
}
Aggregations