This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push:
new c871280acf50 CAMEL-28009: camel-platform-http-vertx - log a WARN when
useGlobalSslContextParameters is enabled without a global SSL configuration
(#31213)
c871280acf50 is described below
commit c871280acf50fcca4ed99fd3f7f0147204dd63ec
Author: Claus Ibsen <[email protected]>
AuthorDate: Wed Dec 2 10:21:29 2026 +0100
CAMEL-28009: camel-platform-http-vertx - log a WARN when
useGlobalSslContextParameters is enabled without a global SSL configuration
(#31213)
[CAMEL-28009](https://issues.apache.org/jira/browse/CAMEL-28009)
When `useGlobalSslContextParameters` is enabled, but the CamelContext has
no global SSL configuration (for example `camel.ssl.enabled` is not set), the
HTTP server started without TLS and nothing said so.
`VertxPlatformHttpServerSupport.configureSSL` now logs a WARN with the port in
that case.
It covers the platform-http-vertx server and the Camel Main servers
(`camel.server.*` and `camel.management.*`), which all go through
`configureSSL`. The server still starts as before; this only makes the missing
SSL configuration visible.
Test: `VertxPlatformHttpServerGlobalSslTest` (new) checks when the
configuration counts as missing; `VertxPlatformHttpEngineTest` passes.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
---
.../http/vertx/VertxPlatformHttpServerSupport.java | 14 +++++
.../VertxPlatformHttpServerGlobalSslTest.java | 66 ++++++++++++++++++++++
2 files changed, 80 insertions(+)
diff --git
a/components/camel-platform-http-vertx/src/main/java/org/apache/camel/component/platform/http/vertx/VertxPlatformHttpServerSupport.java
b/components/camel-platform-http-vertx/src/main/java/org/apache/camel/component/platform/http/vertx/VertxPlatformHttpServerSupport.java
index ab5224550110..a113514fca76 100644
---
a/components/camel-platform-http-vertx/src/main/java/org/apache/camel/component/platform/http/vertx/VertxPlatformHttpServerSupport.java
+++
b/components/camel-platform-http-vertx/src/main/java/org/apache/camel/component/platform/http/vertx/VertxPlatformHttpServerSupport.java
@@ -183,8 +183,22 @@ public final class VertxPlatformHttpServerSupport {
if (sslParameters != null) {
VertxHelper.setupSSLOptions(camelContext, sslParameters, options);
+ } else if (isGlobalSslMissing(configuration, camelContext)) {
+ LOG.warn("useGlobalSslContextParameters is enabled, but there is
no global SSL configuration (such as"
+ + " camel.ssl.enabled=true with a key store): the HTTP
server on port {} does not use TLS.",
+ configuration.getBindPort());
}
return options;
}
+
+ /**
+ * Whether TLS is asked for with useGlobalSslContextParameters, but the
CamelContext has no global SSL configuration
+ * and the server has none of its own, so the server does not use TLS.
+ */
+ static boolean isGlobalSslMissing(VertxPlatformHttpServerConfiguration
configuration, CamelContext camelContext) {
+ return configuration.isUseGlobalSslContextParameters()
+ && configuration.getSslContextParameters() == null
+ && camelContext.getSSLContextParameters() == null;
+ }
}
diff --git
a/components/camel-platform-http-vertx/src/test/java/org/apache/camel/component/platform/http/vertx/VertxPlatformHttpServerGlobalSslTest.java
b/components/camel-platform-http-vertx/src/test/java/org/apache/camel/component/platform/http/vertx/VertxPlatformHttpServerGlobalSslTest.java
new file mode 100644
index 000000000000..1cdd009be6f9
--- /dev/null
+++
b/components/camel-platform-http-vertx/src/test/java/org/apache/camel/component/platform/http/vertx/VertxPlatformHttpServerGlobalSslTest.java
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.platform.http.vertx;
+
+import io.vertx.core.http.HttpServerOptions;
+import org.apache.camel.CamelContext;
+import org.apache.camel.impl.DefaultCamelContext;
+import org.apache.camel.support.jsse.SSLContextParameters;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+/**
+ * useGlobalSslContextParameters without a global SSL configuration leaves the
server without TLS, which is told with a
+ * WARN.
+ */
+public class VertxPlatformHttpServerGlobalSslTest {
+
+ @Test
+ public void testGlobalSslAskedForButMissing() throws Exception {
+ try (CamelContext context = new DefaultCamelContext()) {
+ VertxPlatformHttpServerConfiguration configuration = new
VertxPlatformHttpServerConfiguration();
+ configuration.setUseGlobalSslContextParameters(true);
+
+
assertTrue(VertxPlatformHttpServerSupport.isGlobalSslMissing(configuration,
context));
+ HttpServerOptions options
+ = VertxPlatformHttpServerSupport.configureSSL(new
HttpServerOptions(), configuration, context);
+ assertFalse(options.isSsl());
+ }
+ }
+
+ @Test
+ public void testGlobalSslConfigured() throws Exception {
+ try (CamelContext context = new DefaultCamelContext()) {
+ context.setSSLContextParameters(new SSLContextParameters());
+ VertxPlatformHttpServerConfiguration configuration = new
VertxPlatformHttpServerConfiguration();
+ configuration.setUseGlobalSslContextParameters(true);
+
+
assertFalse(VertxPlatformHttpServerSupport.isGlobalSslMissing(configuration,
context));
+ }
+ }
+
+ @Test
+ public void testGlobalSslNotAskedFor() throws Exception {
+ try (CamelContext context = new DefaultCamelContext()) {
+ VertxPlatformHttpServerConfiguration configuration = new
VertxPlatformHttpServerConfiguration();
+
+
assertFalse(VertxPlatformHttpServerSupport.isGlobalSslMissing(configuration,
context));
+ }
+ }
+}