Skip to content

Commit

Permalink
Enable OpenSSL for proton and MQTT
Browse files Browse the repository at this point in the history
  • Loading branch information
ctron committed Apr 4, 2019
1 parent f6f3d6a commit 3632e07
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
3 changes: 2 additions & 1 deletion containers/base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ RUN yum install -y java-11-openjdk java-11-openjdk-devel rh-maven35 iproute git
RUN yum install -y lsof

ENV \
NETTY_TCNATIVE_VERSION=${NETTY_TCNATIVE_VERSION}
NETTY_TCNATIVE_VERSION=${NETTY_TCNATIVE_VERSION} \
WITH_OPENSSL=true

RUN yum install -y apr

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ private ProtonClientOptions getOptions() {
final ProtonClientOptions options = new ProtonClientOptions();

is("WITH_OPENSSL", () -> {
System.out.println("Using OpenSSL for proton");
options.setSslEngineOptions(new OpenSSLEngineOptions());
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
package de.dentrassi.hono.simulator.mqtt;

import static de.dentrassi.hono.demo.common.Register.shouldRegister;
import static io.glutamate.lang.Environment.is;

import java.util.Random;
import java.util.concurrent.atomic.AtomicLong;
Expand All @@ -23,6 +24,7 @@
import io.netty.handler.codec.mqtt.MqttConnectReturnCode;
import io.netty.handler.codec.mqtt.MqttQoS;
import io.vertx.core.Vertx;
import io.vertx.core.net.OpenSSLEngineOptions;
import io.vertx.mqtt.MqttClient;
import io.vertx.mqtt.MqttClientOptions;
import io.vertx.mqtt.MqttConnectionException;
Expand Down Expand Up @@ -95,6 +97,11 @@ public Device(final Vertx vertx, final String username, final String deviceId, f
options.setUsername(username + "@" + tenant);
options.setPassword(password);

is("WITH_OPENSSL", () -> {
System.out.println("Using OpenSSL for MQTT");
options.setSslEngineOptions(new OpenSSLEngineOptions());
});

this.client = new MqttClientImpl(vertx, options);

this.client.publishCompletionHandler(this::publishComplete);
Expand Down

0 comments on commit 3632e07

Please sign in to comment.