Skip to content

Commit

Permalink
Add RabbitMQ connector attribute to set ssl hostname verification alg…
Browse files Browse the repository at this point in the history
…orithm
  • Loading branch information
ozangunalp committed Mar 1, 2024
1 parent ac504e0 commit 06801da
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
@ConnectorAttribute(name = "port", direction = INCOMING_AND_OUTGOING, description = "The broker port", type = "int", alias = "rabbitmq-port", defaultValue = "5672")
@ConnectorAttribute(name = "addresses", direction = INCOMING_AND_OUTGOING, description = "The multiple addresses for cluster mode, when given overrides the host and port", type = "string", alias = "rabbitmq-addresses")
@ConnectorAttribute(name = "ssl", direction = INCOMING_AND_OUTGOING, description = "Whether or not the connection should use SSL", type = "boolean", alias = "rabbitmq-ssl", 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`, and `NONE` (defaults). `NONE` disables the hostname verification.", defaultValue = "NONE")
@ConnectorAttribute(name = "trust-all", direction = INCOMING_AND_OUTGOING, description = "Whether to skip trust certificate verification", type = "boolean", alias = "rabbitmq-trust-all", defaultValue = "false")
@ConnectorAttribute(name = "trust-store-path", direction = INCOMING_AND_OUTGOING, description = "The path to a JKS trust store", type = "string", alias = "rabbitmq-trust-store-path")
@ConnectorAttribute(name = "trust-store-password", direction = INCOMING_AND_OUTGOING, description = "The password of the JKS trust store", type = "string", alias = "rabbitmq-trust-store-password")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,12 @@ static RabbitMQOptions getClientOptions(Vertx vertx, RabbitMQConnectorCommonConf
.setUseNio(config.getUseNio())
.setVirtualHost(config.getVirtualHost());

if ("NONE".equals(config.getSslHostnameVerificationAlgorithm())) {
options.setHostnameVerificationAlgorithm("");
} else {
options.setHostnameVerificationAlgorithm(config.getSslHostnameVerificationAlgorithm());
}

// JKS TrustStore
Optional<String> trustStorePath = config.getTrustStorePath();
if (trustStorePath.isPresent()) {
Expand Down

0 comments on commit 06801da

Please sign in to comment.