Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
yx9o committed Jan 4, 2025
1 parent bc94213 commit 2e806c9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
import io.grpc.netty.shaded.io.netty.buffer.Unpooled;
import io.grpc.netty.shaded.io.netty.handler.codec.haproxy.HAProxyTLV;
import java.nio.charset.StandardCharsets;

import org.apache.rocketmq.common.MixAll;
import org.apache.rocketmq.proxy.config.ConfigurationManager;
import org.junit.Before;
import org.junit.Test;
Expand All @@ -34,13 +36,19 @@ public class ProxyAndTlsProtocolNegotiatorTest {

@Before
public void setUp() throws Exception {
if (!MixAll.isJdk8()) {
return;
}
ConfigurationManager.intConfig();
ConfigurationManager.getProxyConfig().setTlsTestModeEnable(true);
negotiator = new ProxyAndTlsProtocolNegotiator();
}

@Test
public void handleHAProxyTLV() {
if (!MixAll.isJdk8()) {
return;
}
ByteBuf content = Unpooled.buffer();
content.writeBytes("xxxx".getBytes(StandardCharsets.UTF_8));
HAProxyTLV haProxyTLV = new HAProxyTLV((byte) 0xE1, content);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

package org.apache.rocketmq.remoting;

import org.apache.rocketmq.common.MixAll;
import org.apache.rocketmq.common.utils.NetworkUtil;
import org.apache.rocketmq.remoting.common.TlsMode;
import org.apache.rocketmq.remoting.exception.RemotingSendRequestException;
Expand Down Expand Up @@ -281,6 +282,9 @@ public void clientAcceptsUntrustedServerCert() throws Exception {

@Test
public void testTlsConfigThroughFile() throws Exception {
if (!MixAll.isJdk8()) {
return;
}
File file = tempFolder.newFile("tls.config");
tlsTestModeEnable = true;

Expand Down

0 comments on commit 2e806c9

Please sign in to comment.