Issue #215 Conscrypt module for SSL and ALPN

Upgraded to RC11
This commit is contained in:
Greg Wilkins 2017-09-26 10:09:30 +10:00
parent 5764afc6e0
commit 35d0b59434
4 changed files with 10 additions and 6 deletions

View File

@ -15,7 +15,7 @@
<properties>
<bundle-symbolic-name>${project.groupId}.alpn.java.client</bundle-symbolic-name>
<conscrypt.version>1.0.0.RC10</conscrypt.version>
<conscrypt.version>1.0.0.RC11</conscrypt.version>
</properties>
<dependencies>

View File

@ -59,7 +59,7 @@ public class ConscryptClientALPNProcessor implements ALPNProcessor.Client
{
try
{
Method setAlpnProtocols = sslEngine.getClass().getDeclaredMethod("setAlpnProtocols", String[].class);
Method setAlpnProtocols = sslEngine.getClass().getDeclaredMethod("setApplicationProtocols", String[].class);
setAlpnProtocols.setAccessible(true);
ALPNClientConnection alpn = (ALPNClientConnection)connection;
String[] protocols = alpn.getProtocols().toArray(new String[0]);
@ -92,9 +92,9 @@ public class ConscryptClientALPNProcessor implements ALPNProcessor.Client
try
{
SSLEngine sslEngine = alpnConnection.getSSLEngine();
Method method = sslEngine.getClass().getDeclaredMethod("getAlpnSelectedProtocol");
Method method = sslEngine.getClass().getDeclaredMethod("getApplicationProtocol");
method.setAccessible(true);
String protocol = new String((byte[])method.invoke(sslEngine), StandardCharsets.US_ASCII);
String protocol = (String)method.invoke(sslEngine);
alpnConnection.selected(protocol);
}
catch (Throwable e)

View File

@ -13,7 +13,7 @@
<properties>
<bundle-symbolic-name>${project.groupId}.alpn.conscrypt.server</bundle-symbolic-name>
<conscrypt.version>1.0.0.RC10</conscrypt.version>
<conscrypt.version>1.0.0.RC11</conscrypt.version>
</properties>
<dependencies>

View File

@ -288,7 +288,9 @@ public class HTTP2CServerTest extends AbstractServerTest
{
AtomicLong fills = new AtomicLong();
// Remove "h2c", leaving only "http/1.1".
connector.clearConnectionFactories();
connector.stop();
connector.removeConnectionFactory("h2c");
connector.start();
HttpConnectionFactory connectionFactory = new HttpConnectionFactory()
{
@Override
@ -306,8 +308,10 @@ public class HTTP2CServerTest extends AbstractServerTest
return configure(connection, connector, endPoint);
}
};
connector.stop();
connector.addConnectionFactory(connectionFactory);
connector.setDefaultProtocol(connectionFactory.getProtocol());
connector.start();
// Now send a HTTP/2 direct request, which
// will have the PRI * HTTP/2.0 preface.