Skip to content

Commit b9a7b5b

Browse files
committed
fix(ci): resolve netty-tcnative UnsatisfiedLinkError (Round 8)
Http2ProtocolProxyHandler hard-coded SslProvider.OPENSSL which requires netty-tcnative-boringssl-static native library. That dependency was removed in Round 4 to fix a Bazel cycle dependency. Apply the same fallback pattern used by MultiProtocolTlsHelper and ProxyAndTlsProtocolNegotiator: check OpenSsl.isAvailable() and fall back to SslProvider.JDK when the native library is not present.
1 parent 806674a commit b9a7b5b

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

proxy/src/main/java/org/apache/rocketmq/proxy/remoting/protocol/http2proxy/Http2ProtocolProxyHandler.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import io.netty.handler.codec.haproxy.HAProxyMessageEncoder;
2828
import io.netty.handler.ssl.ApplicationProtocolConfig;
2929
import io.netty.handler.ssl.ApplicationProtocolNames;
30+
import io.netty.handler.ssl.OpenSsl;
3031
import io.netty.handler.ssl.SslContext;
3132
import io.netty.handler.ssl.SslContextBuilder;
3233
import io.netty.handler.ssl.SslHandler;
@@ -63,9 +64,10 @@ public Http2ProtocolProxyHandler() {
6364
if (TlsMode.DISABLED.equals(tlsMode)) {
6465
sslContext = null;
6566
} else {
67+
SslProvider provider = OpenSsl.isAvailable() ? SslProvider.OPENSSL : SslProvider.JDK;
6668
sslContext = SslContextBuilder
6769
.forClient()
68-
.sslProvider(SslProvider.OPENSSL)
70+
.sslProvider(provider)
6971
.trustManager(InsecureTrustManagerFactory.INSTANCE)
7072
.applicationProtocolConfig(new ApplicationProtocolConfig(
7173
ApplicationProtocolConfig.Protocol.ALPN,

0 commit comments

Comments
 (0)