Skip to content

Commit 80d0a47

Browse files
committed
Netty 4.1.49.Final upgrade - see vert-x3/issues#526
1 parent 9b84a09 commit 80d0a47

File tree

6 files changed

+46
-43
lines changed

6 files changed

+46
-43
lines changed

.travis.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ branches:
33
only:
44
- master
55
- /^\d+\.\d+$/
6+
before_install:
7+
- wget https://github.com/sormuras/bach/raw/master/install-jdk.sh
68
cache:
79
directories:
810
- $HOME/.m2
@@ -14,6 +16,7 @@ jobs:
1416
name: "OpenJDK 8"
1517
jdk: openjdk8
1618
script: mvn -q clean verify -B
19+
install: . ./install-jdk.sh --url "https://api.adoptopenjdk.net/v2/binary/releases/openjdk8?openjdk_impl=hotspot&os=linux&type=jdk&release=latest&heap_size=normal&arch=x64"
1720
- if: type != pull_request
1821
name: "OpenJDK 11"
1922
jdk: openjdk11
@@ -22,10 +25,16 @@ jobs:
2225
name: "OpenJDK 8 / native transport"
2326
jdk: openjdk8
2427
script: mvn -q clean verify -B -PtestNativeTransport
28+
install: . ./install-jdk.sh --url "https://api.adoptopenjdk.net/v2/binary/releases/openjdk8?openjdk_impl=hotspot&os=linux&type=jdk&release=latest&heap_size=normal&arch=x64"
2529
- if: type != pull_request
2630
name: "OpenJDK 8 / domain sockets"
2731
jdk: openjdk8
2832
script: mvn -q clean verify -B -PtestDomainSockets
33+
install: . ./install-jdk.sh --url "https://api.adoptopenjdk.net/v2/binary/releases/openjdk8?openjdk_impl=hotspot&os=linux&type=jdk&release=latest&heap_size=normal&arch=x64"
34+
- stage: test
35+
name: "OpenJDK 8 / ALPN agent"
36+
jdk: openjdk8
37+
script: mvn -q clean verify -B -Dtest=Http*TLSTest
2938
- stage: deploy
3039
name: "Deploy to Sonatype's snapshots repository"
3140
jdk: openjdk8

pom.xml

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@
357357
<version>2.19.1</version>
358358
<executions>
359359
<execution>
360-
<id>no-alpn</id>
360+
<id>ssl-engine:default</id>
361361
<goals>
362362
<goal>integration-test</goal>
363363
<goal>verify</goal>
@@ -367,7 +367,6 @@
367367
<include>io/vertx/it/SSLEngineTest.java</include>
368368
</includes>
369369
<systemProperties>
370-
<vertx-test-alpn-jdk>false</vertx-test-alpn-jdk>
371370
<vertx-test-alpn-openssl>false</vertx-test-alpn-openssl>
372371
</systemProperties>
373372
<classpathDependencyExcludes>
@@ -376,7 +375,7 @@
376375
</configuration>
377376
</execution>
378377
<execution>
379-
<id>openssl-alpn</id>
378+
<id>ssl-engine:openssl</id>
380379
<goals>
381380
<goal>integration-test</goal>
382381
<goal>verify</goal>
@@ -386,14 +385,12 @@
386385
<include>io/vertx/it/SSLEngineTest.java</include>
387386
</includes>
388387
<systemProperties>
389-
<vertx-test-alpn-jdk>false</vertx-test-alpn-jdk>
390388
<vertx-test-alpn-openssl>true</vertx-test-alpn-openssl>
391-
<vertx-test-sslcontext>openssl</vertx-test-sslcontext>
392389
</systemProperties>
393390
</configuration>
394391
</execution>
395392
<execution>
396-
<id>jdk-alpn</id>
393+
<id>ssl-engine:agent</id>
397394
<goals>
398395
<goal>integration-test</goal>
399396
<goal>verify</goal>
@@ -404,17 +401,15 @@
404401
<include>io/vertx/it/SSLEngineTest.java</include>
405402
</includes>
406403
<systemProperties>
407-
<vertx-test-alpn-jdk>true</vertx-test-alpn-jdk>
408404
<vertx-test-alpn-openssl>false</vertx-test-alpn-openssl>
409-
<vertx-test-sslcontext>jdk</vertx-test-sslcontext>
410405
</systemProperties>
411406
<classpathDependencyExcludes>
412407
<classpathDependencyExclude>io.netty:netty-tcnative-boringssl-static</classpathDependencyExclude>
413408
</classpathDependencyExcludes>
414409
</configuration>
415410
</execution>
416411
<execution>
417-
<id>jdk-openssl-alpn</id>
412+
<id>ssl-engine:openssl+agent</id>
418413
<goals>
419414
<goal>integration-test</goal>
420415
<goal>verify</goal>
@@ -425,9 +420,7 @@
425420
<include>io/vertx/it/SSLEngineTest.java</include>
426421
</includes>
427422
<systemProperties>
428-
<vertx-test-alpn-jdk>true</vertx-test-alpn-jdk>
429423
<vertx-test-alpn-openssl>true</vertx-test-alpn-openssl>
430-
<vertx-test-sslcontext>jdk</vertx-test-sslcontext>
431424
</systemProperties>
432425
</configuration>
433426
</execution>
@@ -660,7 +653,7 @@
660653
<profile>
661654
<id>java-8</id>
662655
<properties>
663-
<jetty.alpnAgent.version>2.0.9</jetty.alpnAgent.version>
656+
<jetty.alpnAgent.version>2.0.10</jetty.alpnAgent.version>
664657
<jetty.alpnAgent.path>${settings.localRepository}/org/mortbay/jetty/alpn/jetty-alpn-agent/${jetty.alpnAgent.version}/jetty-alpn-agent-${jetty.alpnAgent.version}.jar</jetty.alpnAgent.path>
665658
<jetty.alpnAgent.argLine>-javaagent:"${jetty.alpnAgent.path}"</jetty.alpnAgent.argLine>
666659
</properties>

src/test/java/io/vertx/core/http/Http2Test.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -127,12 +127,13 @@ public void testClientRequestWriteFromOtherThread() throws Exception {
127127
@Test
128128
public void testServerOpenSSL() throws Exception {
129129
HttpServerOptions opts = new HttpServerOptions()
130-
.setPort(DEFAULT_HTTPS_PORT)
131-
.setHost(DEFAULT_HTTPS_HOST)
132-
.setUseAlpn(true)
133-
.setSsl(true)
134-
.addEnabledCipherSuite("TLS_RSA_WITH_AES_128_CBC_SHA") // Non Diffie-helman -> debuggable in wireshark
135-
.setPemKeyCertOptions(Cert.SERVER_PEM.get()).setSslEngineOptions(new OpenSSLEngineOptions());
130+
.setPort(DEFAULT_HTTPS_PORT)
131+
.setHost(DEFAULT_HTTPS_HOST)
132+
.setUseAlpn(true)
133+
.setSsl(true)
134+
.addEnabledCipherSuite("TLS_RSA_WITH_AES_128_CBC_SHA") // Non Diffie-helman -> debuggable in wireshark
135+
.setPemKeyCertOptions(Cert.SERVER_PEM.get())
136+
.setSslEngineOptions(new OpenSSLEngineOptions());
136137
server.close();
137138
client.close();
138139
client = vertx.createHttpClient(createBaseClientOptions());

src/test/java/io/vertx/core/http/Http2TestBase.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
import io.vertx.core.Context;
1515
import io.vertx.core.Vertx;
16+
import io.vertx.core.net.JdkSSLEngineOptions;
1617
import io.vertx.test.tls.Cert;
1718
import io.vertx.test.tls.Trust;
1819

@@ -25,18 +26,20 @@ static HttpServerOptions createHttp2ServerOptions(int port, String host) {
2526
return new HttpServerOptions()
2627
.setPort(port)
2728
.setHost(host)
29+
.setSslEngineOptions(new JdkSSLEngineOptions())
2830
.setUseAlpn(true)
2931
.setSsl(true)
3032
.addEnabledCipherSuite("TLS_RSA_WITH_AES_128_CBC_SHA") // Non Diffie-helman -> debuggable in wireshark
3133
.setKeyStoreOptions(Cert.SERVER_JKS.get());
3234
};
3335

3436
static HttpClientOptions createHttp2ClientOptions() {
35-
return new HttpClientOptions().
36-
setUseAlpn(true).
37-
setSsl(true).
38-
setTrustStoreOptions(Trust.SERVER_JKS.get()).
39-
setProtocolVersion(HttpVersion.HTTP_2);
37+
return new HttpClientOptions()
38+
.setSslEngineOptions(new JdkSSLEngineOptions())
39+
.setUseAlpn(true)
40+
.setSsl(true)
41+
.setTrustStoreOptions(Trust.SERVER_JKS.get())
42+
.setProtocolVersion(HttpVersion.HTTP_2);
4043
}
4144

4245
protected HttpServerOptions serverOptions;

src/test/java/io/vertx/core/http/HttpTLSTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1092,6 +1092,8 @@ TLSTest run(boolean shouldPass) {
10921092
}
10931093
if (clientOpenSSL) {
10941094
options.setOpenSslEngineOptions(new OpenSSLEngineOptions());
1095+
} else {
1096+
options.setJdkSslEngineOptions(new JdkSSLEngineOptions());
10951097
}
10961098
if (clientUsesAlpn) {
10971099
options.setUseAlpn(true);

src/test/java/io/vertx/it/SSLEngineTest.java

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -33,50 +33,43 @@
3333
*/
3434
public class SSLEngineTest extends HttpTestBase {
3535

36-
private static boolean isJava9() {
37-
try {
38-
SSLEngineTest.class.getClassLoader().loadClass("java.lang.invoke.VarHandle");
39-
return true;
40-
} catch (Throwable ignore) {
41-
return false;
42-
}
36+
private static boolean hasAlpn() {
37+
return JdkSSLEngineOptions.isAlpnAvailable();
4338
}
4439

45-
private static final boolean JDK = Boolean.getBoolean("vertx-test-alpn-jdk");
4640
private static boolean OPEN_SSL = Boolean.getBoolean("vertx-test-alpn-openssl");
47-
private static final String EXPECTED_SSL_CONTEXT = isJava9() ? "jdk" : System.getProperty("vertx-test-sslcontext");
4841

4942
public SSLEngineTest() {
5043
}
5144

5245
@Test
53-
public void testDefaultEngineWithAlpn() throws Exception {
54-
doTest(null, true, HttpVersion.HTTP_2, JDK | OPEN_SSL ? "ALPN is not available" : null, EXPECTED_SSL_CONTEXT, false);
46+
public void testDefaultEngineWithAlpn() {
47+
doTest(null, true, HttpVersion.HTTP_2, hasAlpn() | OPEN_SSL ? null : "ALPN not available for JDK SSL/TLS engine", hasAlpn() ? "jdk" : "openssl", false);
5548
}
5649

5750
@Test
58-
public void testJdkEngineWithAlpn() throws Exception {
59-
doTest(new JdkSSLEngineOptions(), true, HttpVersion.HTTP_2, JDK ? "ALPN not available for JDK SSL/TLS engine" : null, "jdk", false);
51+
public void testJdkEngineWithAlpn() {
52+
doTest(new JdkSSLEngineOptions(), true, HttpVersion.HTTP_2, hasAlpn() ? null : "ALPN not available for JDK SSL/TLS engine", "jdk", false);
6053
}
6154

6255
@Test
63-
public void testOpenSSLEngineWithAlpn() throws Exception {
64-
doTest(new OpenSSLEngineOptions(), true, HttpVersion.HTTP_2, OPEN_SSL ? "OpenSSL is not available" : null, "openssl", true);
56+
public void testOpenSSLEngineWithAlpn() {
57+
doTest(new OpenSSLEngineOptions(), true, HttpVersion.HTTP_2, OPEN_SSL ? null : "OpenSSL is not available", "openssl", true);
6558
}
6659

6760
@Test
68-
public void testDefaultEngine() throws Exception {
61+
public void testDefaultEngine() {
6962
doTest(null, false, HttpVersion.HTTP_1_1, null, "jdk", false);
7063
}
7164

7265
@Test
73-
public void testJdkEngine() throws Exception {
66+
public void testJdkEngine() {
7467
doTest(new JdkSSLEngineOptions(), false, HttpVersion.HTTP_1_1, null, "jdk", false);
7568
}
7669

7770
@Test
78-
public void testOpenSSLEngine() throws Exception {
79-
doTest(new OpenSSLEngineOptions(), false, HttpVersion.HTTP_1_1, "OpenSSL is not available", "openssl", true);
71+
public void testOpenSSLEngine() {
72+
doTest(new OpenSSLEngineOptions(), false, HttpVersion.HTTP_1_1, OPEN_SSL ? null : "OpenSSL is not available", "openssl", true);
8073
}
8174

8275
private void doTest(SSLEngineOptions engine,
@@ -91,8 +84,10 @@ private void doTest(SSLEngineOptions engine,
9184
.setUseAlpn(useAlpn);
9285
try {
9386
server = vertx.createHttpServer(options);
87+
if (error != null) {
88+
fail("Was expecting failure: " + error);
89+
}
9490
} catch (VertxException e) {
95-
e.printStackTrace();
9691
if (error == null) {
9792
fail(e);
9893
} else {

0 commit comments

Comments
 (0)