Skip to content

Commit f29988f

Browse files
author
Zhen
committed
Merge branch '1.4' into 1.5
2 parents 4b21067 + 0c60f63 commit f29988f

File tree

3 files changed

+16
-8
lines changed

3 files changed

+16
-8
lines changed

driver/src/main/java/org/neo4j/driver/internal/net/SocketClient.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,12 +120,17 @@ public void start()
120120
{
121121
try
122122
{
123-
logger.debug( "~~ [CONNECT] %s", address );
123+
logger.debug( "Connecting to %s, secure: %s", address, securityPlan.requiresEncryption() );
124124
if( channel == null )
125125
{
126126
setChannel( ChannelFactory.create( address, securityPlan, timeoutMillis, logger ) );
127+
logger.debug( "Connected to %s, secure: %s", address, securityPlan.requiresEncryption() );
127128
}
128-
setProtocol( negotiateProtocol() );
129+
130+
logger.debug( "Negotiating protocol with %s", address );
131+
SocketProtocol protocol = negotiateProtocol();
132+
setProtocol( protocol );
133+
logger.debug( "Selected protocol %s with %s", protocol.getClass(), address );
129134
}
130135
catch ( ConnectException e )
131136
{
@@ -206,7 +211,7 @@ public void stop()
206211
{
207212
channel.close();
208213
setChannel( null );
209-
logger.debug( "~~ [DISCONNECT]" );
214+
logger.debug( "Disconnected from %s", address );
210215
}
211216
}
212217
catch ( IOException e )

driver/src/main/java/org/neo4j/driver/internal/security/TLSSocketChannel.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,8 @@ public static TLSSocketChannel create( ByteChannel channel, Logger logger, SSLEn
121121
*/
122122
private void runHandshake() throws IOException
123123
{
124-
logger.debug( "~~ [OPENING SECURE CHANNEL]" );
124+
logger.debug( "Running TLS handshake" );
125+
125126
sslEngine.beginHandshake();
126127
HandshakeStatus handshakeStatus = sslEngine.getHandshakeStatus();
127128
while ( handshakeStatus != FINISHED && handshakeStatus != NOT_HANDSHAKING )
@@ -142,6 +143,8 @@ private void runHandshake() throws IOException
142143
break;
143144
}
144145
}
146+
147+
logger.debug( "TLS handshake completed" );
145148
}
146149

147150
private HandshakeStatus runDelegatedTasks()
@@ -423,7 +426,7 @@ public void close() throws IOException
423426
}
424427
// Close transport
425428
channel.close();
426-
logger.debug( "~~ [CLOSED SECURE CHANNEL]" );
429+
logger.debug( "Closed secure channel" );
427430
}
428431
catch ( IOException e )
429432
{

driver/src/test/java/org/neo4j/driver/v1/integration/TLSSocketChannelIT.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ public void shouldPerformTLSHandshakeWithTrustedCert() throws Throwable
124124
sslChannel.close();
125125

126126
// Then
127-
verify( logger, atLeastOnce() ).debug( "~~ [OPENING SECURE CHANNEL]" );
127+
verify( logger, atLeastOnce() ).debug( "Running TLS handshake" );
128128
}
129129
finally
130130
{
@@ -290,7 +290,7 @@ public void shouldPerformTLSHandshakeWithTheSameTrustedServerCert() throws Throw
290290
sslChannel.close();
291291

292292
// Then
293-
verify( logger, atLeastOnce() ).debug( "~~ [OPENING SECURE CHANNEL]" );
293+
verify( logger, atLeastOnce() ).debug( "Running TLS handshake" );
294294
}
295295

296296
@Test
@@ -357,7 +357,7 @@ private void performTLSHandshakeUsingKnownCerts( File knownCerts ) throws Throwa
357357
sslChannel.close();
358358

359359
// Then
360-
verify( logger, atLeastOnce() ).debug( "~~ [CLOSED SECURE CHANNEL]" );
360+
verify( logger, atLeastOnce() ).debug( "Closed secure channel" );
361361
}
362362

363363
private File installRootCertificate() throws Exception

0 commit comments

Comments
 (0)