use of org.neo4j.bolt.v1.transport.socket.client.SecureSocketConnection in project neo4j by neo4j.
the class BoltConfigIT method shouldSupportMultipleConnectors.
@Test
public void shouldSupportMultipleConnectors() throws Throwable {
// Given
// When
// Then
HostnamePort address0 = new HostnamePort("localhost:7888");
assertConnectionAccepted(address0, new WebSocketConnection());
assertConnectionAccepted(address0, new SecureWebSocketConnection());
assertConnectionAccepted(address0, new SocketConnection());
assertConnectionAccepted(address0, new SecureSocketConnection());
HostnamePort address1 = new HostnamePort("localhost:7687");
assertConnectionRejected(address1, new WebSocketConnection());
assertConnectionAccepted(address1, new SecureWebSocketConnection());
assertConnectionRejected(address1, new SocketConnection());
assertConnectionAccepted(address1, new SecureSocketConnection());
}
use of org.neo4j.bolt.v1.transport.socket.client.SecureSocketConnection in project neo4j by neo4j.
the class CertificatesIT method shouldUseConfiguredCertificate.
@Test
public void shouldUseConfiguredCertificate() throws Exception {
// GIVEN
SecureSocketConnection connection = new SecureSocketConnection();
// WHEN
connection.connect(new HostnamePort("localhost:7687")).send(TransportTestUtil.acceptedVersions(1, 0, 0, 0));
// THEN
Set<X509Certificate> certificatesSeen = connection.getServerCertificatesSeen();
assertThat(certificatesSeen, contains(loadCertificateFromDisk()));
}
use of org.neo4j.bolt.v1.transport.socket.client.SecureSocketConnection in project neo4j by neo4j.
the class BoltIT method assertEventuallyServerResponds.
private void assertEventuallyServerResponds(String host, int port) throws Exception {
SecureSocketConnection conn = new SecureSocketConnection();
conn.connect(new HostnamePort(host, port));
conn.send(new byte[] { (byte) 0x60, (byte) 0x60, (byte) 0xB0, (byte) 0x17, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 });
assertThat(conn.recv(4), equalTo(new byte[] { 0, 0, 0, 1 }));
}
Aggregations