gnodet-bot commented on code in PR #28357:
URL: https://github.com/apache/camel/pull/28357#discussion_r4360528091
##########
components/camel-vertx/camel-vertx-websocket/src/main/java/org/apache/camel/component/vertx/websocket/VertxWebsocketComponent.java:
##########
@@ -190,6 +191,17 @@ public void connectConsumer(VertxWebsocketConsumer
consumer) {
return createVertxWebsocketHost(hostConfiguration, hostKey);
});
+ // every consumer on this host and port is served by the one server
the first consumer configured, so a consumer
+ // with other SSLContextParameters cannot be served with them, and
must not start as if it were
+ SSLContextParameters hostSslContextParameters =
host.getHostConfiguration().getSslContextParameters();
+ if (configuration.getSslContextParameters() !=
hostSslContextParameters) {
+ throw new IllegalArgumentException(
+ "Cannot start the consumer for " +
configuration.getWebsocketURI() + " because the server on "
+ + hostKey + " is already
serving consumers with different "
+ + "sslContextParameters. All
consumers on the same host and port must "
+ + "use the same
SSLContextParameters instance.");
Review Comment:
💡 The message says "different sslContextParameters" but the check (`!=`)
also fires when one side is `null` and the other isn't — e.g. a consumer
without SSL starting after one with SSL, or vice versa. Consider making the
message explicit about that case:
```suggestion
"Cannot start the consumer for " +
configuration.getWebsocketURI() + " because the server on "
+ hostKey + " is already
serving consumers with different "
+ "sslContextParameters (one
side may have null while the other doesn't). "
+ "All consumers on the same
host and port must "
+ "use the same
SSLContextParameters instance.");
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]