feat(gateway-vertx): Enable ALPN if a implementation is available.
Gated enabling of ALPN if an implementation is available, for instance from Jetty's ALPN Boot.
@@ -21,6 +21,7 @@ import io.apiman.gateway.platforms.vertx3.http.HttpPolicyAdapter;
import io.vertx.core.Future;
import io.vertx.core.http.HttpServerOptions;
import io.vertx.core.http.HttpServerRequest;
+import io.vertx.core.net.JdkSSLEngineOptions;
import io.vertx.core.net.JksOptions;
/**
@@ -51,6 +52,10 @@ public class HttpsGatewayVerticle extends ApimanVerticleWithEngine {
.setPassword(apimanConfig.getTrustStorePassword())
);
+ if (JdkSSLEngineOptions.isAlpnAvailable()) {
+ sslOptions.setUseAlpn(true);
+ }
+
vertx.createHttpServer(sslOptions)
.requestHandler(this::requestHandler)
.listen(apimanConfig.getPort(VERTICLE_TYPE));
