#6443 wait for handshake to be done before closing the socket

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
This commit is contained in:
Ludovic Orban 2021-06-29 14:41:36 +02:00
parent 92b6f336b6
commit e1daaed90b
1 changed files with 4 additions and 1 deletions

View File

@ -329,7 +329,7 @@ public class SslBytesServerTest extends SslBytesTest
final SSLSocket client2 = newClient(proxy);
threadPool.submit(() ->
Future<Object> handshakeFuture = threadPool.submit(() ->
{
client2.startHandshake();
return null;
@ -361,6 +361,9 @@ public class SslBytesServerTest extends SslBytesTest
// Client Done
TLSRecord doneRecord = proxy.readFromClient();
assertNotNull(doneRecord);
// Wait for socket to be done with handshake
handshakeFuture.get(5, TimeUnit.SECONDS);
// Close
client2.close();
TLSRecord closeRecord = proxy.readFromClient();