Skip to content

Commit

Permalink
Ensure SSLErrorTest also works with boringssl
Browse files Browse the repository at this point in the history
Motivation:

boringssl uses different messages for the ssl alerts which are all uppercase. As we try to match case as well this fails in SSLErrorTest as we expect lower-case.

This test was introduced by 9b7fb2f.

Modifications:

Ensure we first translate everything to lower-case before doing the assert.

Result:

SSLErrorTest also pass when boringssl is used.
  • Loading branch information
normanmaurer committed Dec 7, 2016
1 parent 8d664fa commit 41ea9fa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion handler/src/test/java/io/netty/handler/ssl/SslErrorTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.Locale;


@RunWith(Parameterized.class)
Expand Down Expand Up @@ -238,7 +239,7 @@ public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {
// at the moment as there are no different exceptions for the different alerts.
private static void verifyException(Throwable cause, String messagePart, Promise<Void> promise) {
String message = cause.getMessage();
if (message.contains(messagePart)) {
if (message.toLowerCase(Locale.UK).contains(messagePart.toLowerCase(Locale.UK))) {
promise.setSuccess(null);
} else {
promise.setFailure(new AssertionError("message not contains '" + messagePart + "': " + message));
Expand Down

0 comments on commit 41ea9fa

Please sign in to comment.