Skip to content

Commit

Permalink
Merge pull request #28323 from cescoffier/update-to-vertx-4.3.4
Browse files Browse the repository at this point in the history
Update to Vert.x 4.3.4
  • Loading branch information
gsmet authored Oct 1, 2022
2 parents 036cbcf + 6b795e7 commit 1cdc965
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 67 deletions.
2 changes: 1 addition & 1 deletion bom/application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
<wildfly-client-config.version>1.0.1.Final</wildfly-client-config.version>
<wildfly-elytron.version>1.20.1.Final</wildfly-elytron.version>
<jboss-threads.version>3.4.3.Final</jboss-threads.version>
<vertx.version>4.3.3</vertx.version>
<vertx.version>4.3.4</vertx.version>

<httpclient.version>4.5.13</httpclient.version>
<httpcore.version>4.4.15</httpcore.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,21 @@
import java.util.concurrent.ConcurrentMap;

import javax.net.ssl.KeyManagerFactory;
import javax.net.ssl.SSLException;
import javax.net.ssl.TrustManagerFactory;
import javax.net.ssl.X509KeyManager;

import com.oracle.svm.core.annotate.Alias;
import com.oracle.svm.core.annotate.Substitute;
import com.oracle.svm.core.annotate.TargetClass;

import io.netty.handler.ssl.ApplicationProtocolConfig;
import io.netty.handler.ssl.OpenSslServerContext;
import io.netty.handler.ssl.ClientAuth;
import io.netty.handler.ssl.SslContext;
import io.netty.handler.ssl.SslContextBuilder;
import io.netty.handler.ssl.SslProvider;
import io.vertx.core.MultiMap;
import io.vertx.core.Promise;
import io.vertx.core.Vertx;
import io.vertx.core.VertxException;
import io.vertx.core.dns.AddressResolverOptions;
import io.vertx.core.eventbus.EventBusOptions;
import io.vertx.core.eventbus.impl.HandlerHolder;
Expand Down Expand Up @@ -140,83 +139,57 @@ EventBusOptions options() {
}
}

@TargetClass(className = "io.vertx.core.net.impl.SSLHelper")
final class Target_io_vertx_core_net_impl_SSLHelper {

@Alias
private boolean client;
@TargetClass(className = "io.vertx.core.spi.tls.DefaultSslContextFactory")
final class Target_DefaultSslContextFactory {

@Alias
private Set<String> enabledCipherSuites;

@Alias
private boolean openSsl;

@Alias
private List<String> applicationProtocols;

@Alias
private KeyManagerFactory getKeyMgrFactory(VertxInternal vertx) throws Exception {
return null;
}
private ClientAuth clientAuth;

@Substitute
private SslContext createContext(VertxInternal vertx, boolean useAlpn, X509KeyManager mgr,
TrustManagerFactory trustMgrFactory) {
try {
SslContextBuilder builder;
if (client) {
builder = SslContextBuilder.forClient();
KeyManagerFactory keyMgrFactory = getKeyMgrFactory(vertx);
if (keyMgrFactory != null) {
builder.keyManager(keyMgrFactory);
}
} else {
if (mgr != null) {
builder = SslContextBuilder.forServer(mgr.getPrivateKey(null), null, mgr.getCertificateChain(null));
} else {
KeyManagerFactory keyMgrFactory = getKeyMgrFactory(vertx);
if (keyMgrFactory == null) {
throw new VertxException("Key/certificate is mandatory for SSL");
}
builder = SslContextBuilder.forServer(keyMgrFactory);
}
}
Collection<String> cipherSuites = enabledCipherSuites;
if (openSsl) {
throw new UnsupportedOperationException("OpenSSL not supported in native images");
} else {
builder.sslProvider(SslProvider.JDK);
if (cipherSuites == null || cipherSuites.isEmpty()) {
cipherSuites = Target_io_vertx_core_net_impl_DefaultJDKCipherSuite.get();
}
}
if (trustMgrFactory != null) {
builder.trustManager(trustMgrFactory);
private SslContext createContext(boolean useAlpn, boolean client, KeyManagerFactory kmf, TrustManagerFactory tmf)
throws SSLException {
SslContextBuilder builder;
if (client) {
builder = SslContextBuilder.forClient();
if (kmf != null) {
builder.keyManager(kmf);
}
if (cipherSuites != null && cipherSuites.size() > 0) {
builder.ciphers(cipherSuites);
}
if (useAlpn && applicationProtocols != null && applicationProtocols.size() > 0) {
builder.applicationProtocolConfig(new ApplicationProtocolConfig(
ApplicationProtocolConfig.Protocol.ALPN,
ApplicationProtocolConfig.SelectorFailureBehavior.NO_ADVERTISE,
ApplicationProtocolConfig.SelectedListenerFailureBehavior.ACCEPT,
applicationProtocols));
}
SslContext ctx = builder.build();
if (ctx instanceof OpenSslServerContext) {
throw new UnsupportedOperationException("OpenSSL not supported in native images");
}
return ctx;
} catch (Exception e) {
throw new VertxException(e);
} else {
builder = SslContextBuilder.forServer(kmf);
}
Collection<String> cipherSuites = enabledCipherSuites;
builder.sslProvider(SslProvider.JDK);
if (cipherSuites == null || cipherSuites.isEmpty()) {
cipherSuites = Target_io_vertx_core_spi_tls_DefaultJDKCipherSuite.get();
}
if (tmf != null) {
builder.trustManager(tmf);
}
if (cipherSuites != null && cipherSuites.size() > 0) {
builder.ciphers(cipherSuites);
}
if (useAlpn && applicationProtocols != null && applicationProtocols.size() > 0) {
builder.applicationProtocolConfig(new ApplicationProtocolConfig(
ApplicationProtocolConfig.Protocol.ALPN,
ApplicationProtocolConfig.SelectorFailureBehavior.NO_ADVERTISE,
ApplicationProtocolConfig.SelectedListenerFailureBehavior.ACCEPT,
applicationProtocols));
}
if (clientAuth != null) {
builder.clientAuth(clientAuth);
}
return builder.build();
}
}

@TargetClass(className = "io.vertx.core.net.impl.DefaultJDKCipherSuite")
final class Target_io_vertx_core_net_impl_DefaultJDKCipherSuite {
@TargetClass(className = "io.vertx.core.spi.tls.DefaultJDKCipherSuite")
final class Target_io_vertx_core_spi_tls_DefaultJDKCipherSuite {
@Alias
static List<String> get() {
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -463,11 +463,21 @@ public long setPeriodic(long l, Handler<Long> handler) {
return getDelegate().setPeriodic(l, handler);
}

@Override
public long setPeriodic(long initialDelay, long delay, Handler<Long> handler) {
return getDelegate().setPeriodic(initialDelay, delay, handler);
}

@Override
public TimeoutStream periodicStream(long l) {
return getDelegate().periodicStream(l);
}

@Override
public TimeoutStream periodicStream(long initialDelay, long delay) {
return getDelegate().periodicStream(initialDelay, delay);
}

@Override
public boolean cancelTimer(long l) {
return getDelegate().cancelTimer(l);
Expand Down
2 changes: 1 addition & 1 deletion independent-projects/resteasy-reactive/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
<jakarta.json.version>1.1.6</jakarta.json.version>
<mutiny.version>1.7.0</mutiny.version>
<smallrye-common.version>1.13.1</smallrye-common.version>
<vertx.version>4.3.2</vertx.version>
<vertx.version>4.3.4</vertx.version>
<rest-assured.version>4.5.1</rest-assured.version>
<commons-logging-jboss-logging.version>1.0.0.Final</commons-logging-jboss-logging.version>
<jboss-jaxb-api_2.3_spec.version>2.0.0.Final</jboss-jaxb-api_2.3_spec.version>
Expand Down

0 comments on commit 1cdc965

Please sign in to comment.