Fixed test that was failing due to TLS 1.3 backport to Java 8.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
This commit is contained in:
Simone Bordet 2020-11-17 13:39:28 +01:00
parent 71087e53a6
commit 1d71cabef4
1 changed files with 8 additions and 1 deletions

View File

@ -164,8 +164,15 @@ public class ALPNNegotiationTest extends AbstractALPNTest
encrypted.flip();
}
assertEquals(21, encrypted.get());
// TLS 1.3 may send 2 alerts: "user_canceled" followed by "close_notify".
encrypted.clear();
assertEquals(-1, channel.read(encrypted));
read = channel.read(encrypted);
if (read > 0)
{
encrypted.clear();
read = channel.read(encrypted);
}
assertEquals(-1, read);
}
}