Skip to content

Commit

Permalink
Update to Vert.x 4.5.4
Browse files Browse the repository at this point in the history
In this commit, an adjustment was made for MQTT functionality. Specifically, the hostname verifier now requires explicit configuration. Consequently, this commit introduces a new property and configures it with the `HTTPS` value. You can switch back to the previous behavior by setting this property to "NONE".
  • Loading branch information
cescoffier committed Feb 26, 2024
1 parent 6d7bd15 commit 67d9546
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>

<vertx.version>4.5.3</vertx.version>
<vertx.version>4.5.4</vertx.version>
<rxjava.version>2.2.21</rxjava.version>
<cloudevent.version>1.1.0</cloudevent.version>
<weld.version>5.1.2.Final</weld.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
@ConnectorAttribute(name = "auto-keep-alive", type = "boolean", direction = INCOMING_AND_OUTGOING, description = "Set if the MQTT client must handle `PINGREQ` automatically", defaultValue = "true")
@ConnectorAttribute(name = "health-enabled", type = "boolean", direction = INCOMING_AND_OUTGOING, description = "Whether health reporting is enabled (default) or disabled", defaultValue = "true")
@ConnectorAttribute(name = "ssl", type = "boolean", direction = INCOMING_AND_OUTGOING, description = "Set whether SSL/TLS is enabled", defaultValue = "false")
@ConnectorAttribute(name = "ssl.hostname-verification-algorithm", type = "string", direction = INCOMING_AND_OUTGOING, description = "Set the hostname verifier algorithm for the TLS connection.Accepted values are `HTTPS` (default), `LDAPS`, and `NONE`. `NONE` disables the hostname verification.", defaultValue = "HTTPS")
@ConnectorAttribute(name = "ssl.keystore.type", type = "string", direction = INCOMING_AND_OUTGOING, description = "Set the keystore type [`pkcs12`, `jks`, `pem`]", defaultValue = "pkcs12")
@ConnectorAttribute(name = "ssl.keystore.location", type = "string", direction = INCOMING_AND_OUTGOING, description = "Set the keystore location. In case of `pem` type this is the server ca cert path")
@ConnectorAttribute(name = "ssl.keystore.password", type = "string", direction = INCOMING_AND_OUTGOING, description = "Set the keystore password. In case of `pem` type this is the key path")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ private static MqttClientSessionOptions createMqttClientOptions(MqttConnectorCom
options.setPort(config.getPort().orElseGet(() -> config.getSsl() ? 8883 : 1883));
options.setReconnectDelay(getReconnectDelayOptions(config));
options.setSsl(config.getSsl());

String algorithm = config.getSslHostnameVerificationAlgorithm();
if ("NONE".equalsIgnoreCase(algorithm)) {
options.setHostnameVerificationAlgorithm("");
} else {
options.setHostnameVerificationAlgorithm(algorithm);
}

options.setKeyCertOptions(getKeyCertOptions(config));
options.setServerName(config.getServerName());
options.setTrustOptions(getTrustOptions(config));
Expand All @@ -53,6 +61,7 @@ private static MqttClientSessionOptions createMqttClientOptions(MqttConnectorCom
options.setWillRetain(config.getWillRetain());
options.setUnsubscribeOnDisconnect(config.getUnsubscribeOnDisconnection());
options.setMetricsName("mqtt|" + config.getChannel());

return options;
}

Expand Down

0 comments on commit 67d9546

Please sign in to comment.