Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
<slf4j.version>2.0.17</slf4j.version>
<logback.version>1.5.18</logback.version>
<netty.version>4.2.3.Final</netty.version>
<netty-tcnative.version>2.0.72.Final</netty-tcnative.version>
<metrics.version>4.2.33</metrics.version>
<micrometer.version>1.15.2</micrometer.version>
<picocli.version>4.7.7</picocli.version>
Expand Down Expand Up @@ -154,6 +155,13 @@
<classifier>linux-x86_64</classifier>
</dependency>

<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-tcnative-boringssl-static</artifactId>
<version>${netty-tcnative.version}</version>
<classifier>linux-x86_64</classifier>
</dependency>

<dependency>
<groupId>org.jgroups</groupId>
<artifactId>jgroups</artifactId>
Expand Down Expand Up @@ -204,6 +212,14 @@
<scope>provided</scope>
</dependency>

<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-tcnative-boringssl-static</artifactId>
<version>${netty-tcnative.version}</version>
<classifier>osx-aarch_64</classifier>
<scope>test</scope>
</dependency>

</dependencies>

<dependencyManagement>
Expand Down
15 changes: 15 additions & 0 deletions src/main/java/com/rabbitmq/stream/perf/StreamPerfTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
import io.netty.channel.uring.IoUringSocketChannel;
import io.netty.handler.ssl.SslContextBuilder;
import io.netty.handler.ssl.SslHandler;
import io.netty.handler.ssl.SslProvider;
import io.netty.util.internal.PlatformDependent;
import java.io.IOException;
import java.io.PrintStream;
Expand Down Expand Up @@ -512,6 +513,18 @@ void setNativeIoUring(String input) throws Exception {

volatile boolean nativeIoUring;

@CommandLine.Option(
names = {"--tls-tcnative", "-ttc"},
description = "use Netty's tcnative with BoringSSL (Linux x86-64 only)",
arity = "0..1",
fallbackValue = "true",
defaultValue = "false")
void setTlsTcNative(String input) throws Exception {
this.tlsTcNative = Converters.BOOLEAN_TYPE_CONVERTER.convert(input);
}

volatile boolean tlsTcNative;

@ArgGroup(exclusive = false, multiplicity = "0..1")
InstanceSyncOptions instanceSyncOptions;

Expand Down Expand Up @@ -1003,10 +1016,12 @@ public Integer call() throws Exception {
java.util.function.Consumer<io.netty.channel.Channel> channelCustomizer = channel -> {};

if (tls) {
SslProvider sslProvider = this.tlsTcNative ? SslProvider.OPENSSL : SslProvider.JDK;
TlsConfiguration tlsConfiguration = environmentBuilder.tls();
tlsConfiguration =
tlsConfiguration.sslContext(
SslContextBuilder.forClient()
.sslProvider(sslProvider)
.trustManager(Utils.TRUST_EVERYTHING_TRUST_MANAGER)
.build());
environmentBuilder = tlsConfiguration.environmentBuilder();
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/com/rabbitmq/stream/perf/Host.java
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ static Process rabbitmqctl(String command) throws IOException {
}

static String rabbitmqctlCommand() {
String rabbitmqCtl = System.getProperty("rabbitmqctl.bin", DOCKER_PREFIX);
String rabbitmqCtl = System.getProperty("rabbitmqctl.bin", DOCKER_PREFIX + "rabbitmq");
if (rabbitmqCtl.startsWith(DOCKER_PREFIX)) {
String containerId = rabbitmqCtl.split(":")[1];
return "docker exec " + containerId + " rabbitmqctl";
Expand Down
14 changes: 11 additions & 3 deletions src/test/java/com/rabbitmq/stream/perf/StreamPerfTestTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
import org.junit.jupiter.api.extension.ExtendWith;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.CsvSource;
import org.junit.jupiter.params.provider.ValueSource;

@ExtendWith(TestUtils.StreamTestInfrastructureExtension.class)
public class StreamPerfTestTest {
Expand Down Expand Up @@ -285,12 +286,14 @@ void publishingSequenceShouldNotBeStoredWhenProducerNamesAreNotSet() throws Exce
waitRunEnds();
}

@Test
@ParameterizedTest
@ValueSource(booleans = {true, false})
@DisabledIfTlsNotEnabled
void shouldConnectWithTls() throws Exception {
void shouldConnectWithTls(boolean tlsTcNative) throws Exception {
ArgumentsBuilder builder = builder().tlsTcNative(tlsTcNative);
Future<?> run =
run(
builder()
builder
.uris("rabbitmq-stream+tls://guest:guest@localhost:5551/%2f")
.serverNameIndication("localhost"));
waitUntilStreamExists(s);
Expand Down Expand Up @@ -641,6 +644,11 @@ ArgumentsBuilder uris(String url) {
return this;
}

public ArgumentsBuilder tlsTcNative(boolean tlsTcNative) {
arguments.put("tls-tcnative", String.valueOf(tlsTcNative));
return this;
}

ArgumentsBuilder serverNameIndication(String sni) {
arguments.put("server-name-indication", sni);
return this;
Expand Down