summaryrefslogtreecommitdiffstats
path: root/core/tests
diff options
context:
space:
mode:
authorKenny Root <kroot@google.com>2013-06-25 12:00:34 -0700
committerKenny Root <kroot@google.com>2013-06-26 10:35:39 -0700
commit100d7290264338c6536739abd59879aaaa812537 (patch)
treed5ec188e2a17fe9246a045e2b54245cfba2840bf /core/tests
parent3e7d0344399ac2f607fddde32c1a5e54228a38f9 (diff)
downloadframeworks_base-100d7290264338c6536739abd59879aaaa812537.zip
frameworks_base-100d7290264338c6536739abd59879aaaa812537.tar.gz
frameworks_base-100d7290264338c6536739abd59879aaaa812537.tar.bz2
Add ALPN support to SSL socket factory
This adds the ability to use Application-Layer Protocol Negotiation (ALPN) through the SSLCertificateSocketFactory. ALPN is essentially like Next Protocol Negotiation (NPN) but negotiation is done in the clear. This allows the use of other protocols on the same port (e.g., SPDY instead of HTTP on port 80). Change-Id: Ie62926b455e252c4c98670bbbecc1eb5c6f13990
Diffstat (limited to 'core/tests')
-rw-r--r--core/tests/coretests/src/android/net/SSLTest.java16
1 files changed, 8 insertions, 8 deletions
diff --git a/core/tests/coretests/src/android/net/SSLTest.java b/core/tests/coretests/src/android/net/SSLTest.java
index 27b699d..45d28ae 100644
--- a/core/tests/coretests/src/android/net/SSLTest.java
+++ b/core/tests/coretests/src/android/net/SSLTest.java
@@ -49,35 +49,35 @@ public class SSLTest extends TestCase {
// System.out.println(new String(b));
}
- public void testStringsToNpnBytes() {
+ public void testStringsToLengthPrefixedBytes() {
byte[] expected = {
6, 's', 'p', 'd', 'y', '/', '2',
8, 'h', 't', 't', 'p', '/', '1', '.', '1',
};
- assertTrue(Arrays.equals(expected, SSLCertificateSocketFactory.toNpnProtocolsList(
+ assertTrue(Arrays.equals(expected, SSLCertificateSocketFactory.toLengthPrefixedList(
new byte[] { 's', 'p', 'd', 'y', '/', '2' },
new byte[] { 'h', 't', 't', 'p', '/', '1', '.', '1' })));
}
- public void testStringsToNpnBytesEmptyArray() {
+ public void testStringsToLengthPrefixedBytesEmptyArray() {
try {
- SSLCertificateSocketFactory.toNpnProtocolsList();
+ SSLCertificateSocketFactory.toLengthPrefixedList();
fail();
} catch (IllegalArgumentException expected) {
}
}
- public void testStringsToNpnBytesEmptyByteArray() {
+ public void testStringsToLengthPrefixedBytesEmptyByteArray() {
try {
- SSLCertificateSocketFactory.toNpnProtocolsList(new byte[0]);
+ SSLCertificateSocketFactory.toLengthPrefixedList(new byte[0]);
fail();
} catch (IllegalArgumentException expected) {
}
}
- public void testStringsToNpnBytesOversizedInput() {
+ public void testStringsToLengthPrefixedBytesOversizedInput() {
try {
- SSLCertificateSocketFactory.toNpnProtocolsList(new byte[256]);
+ SSLCertificateSocketFactory.toLengthPrefixedList(new byte[256]);
fail();
} catch (IllegalArgumentException expected) {
}