summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenny Root <kroot@google.com>2014-11-17 12:32:25 -0800
committerKenny Root <kroot@google.com>2014-11-17 12:40:18 -0800
commite9795c29b377a5c5b51b87c4f2fcdbf7ae0cd83b (patch)
tree665e17c92927180ffa7d6b0b75482651389d9d37
parent9a9c59af7f1003f6e35ce060482eefda40b380f1 (diff)
downloadlibcore-e9795c29b377a5c5b51b87c4f2fcdbf7ae0cd83b.zip
libcore-e9795c29b377a5c5b51b87c4f2fcdbf7ae0cd83b.tar.gz
libcore-e9795c29b377a5c5b51b87c4f2fcdbf7ae0cd83b.tar.bz2
SSLSocketTest: add error message test for fallback_scsv
The upgrade to OpenSSL 1.0.1j caused a regression for the error message produced by inappropriate fallback protection mechanism. Add a test to make sure this doesn't happen again. (cherry picked from commit cce4d86d447d0e86f94035dd0285726c4025fae6) Bug: 18018599 Change-Id: If8896d8f644095c13cbe44dd8ba7d4ef235385cf
-rw-r--r--luni/src/test/java/libcore/javax/net/ssl/SSLSocketTest.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/luni/src/test/java/libcore/javax/net/ssl/SSLSocketTest.java b/luni/src/test/java/libcore/javax/net/ssl/SSLSocketTest.java
index 4681877..ff055b2 100644
--- a/luni/src/test/java/libcore/javax/net/ssl/SSLSocketTest.java
+++ b/luni/src/test/java/libcore/javax/net/ssl/SSLSocketTest.java
@@ -1667,6 +1667,10 @@ public class SSLSocketTest extends TestCase {
server.startHandshake();
fail("Should result in inappropriate fallback");
} catch (SSLHandshakeException expected) {
+ Throwable cause = expected.getCause();
+ assertEquals(SSLProtocolException.class, cause.getClass());
+ assertTrue(cause.getMessage(),
+ cause.getMessage().contains("inappropriate fallback"));
}
return null;
}
@@ -1679,6 +1683,10 @@ public class SSLSocketTest extends TestCase {
client.startHandshake();
fail("Should receive TLS alert inappropriate fallback");
} catch (SSLHandshakeException expected) {
+ Throwable cause = expected.getCause();
+ assertEquals(SSLProtocolException.class, cause.getClass());
+ assertTrue(cause.getMessage(),
+ cause.getMessage().contains("inappropriate fallback"));
}
return null;
}