diff --git a/extensions/vertx-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/VertxHttpRecorder.java b/extensions/vertx-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/VertxHttpRecorder.java index a0f973be8b94b6..d8d4a28e3ba105 100644 --- a/extensions/vertx-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/VertxHttpRecorder.java +++ b/extensions/vertx-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/VertxHttpRecorder.java @@ -1187,8 +1187,10 @@ public void handle(AsyncResult event) { if (https) { actualHttpsPort = actualPort; + validateHttpPorts(actualHttpPort, actualHttpsPort); } else { actualHttpPort = actualPort; + validateHttpPorts(actualHttpPort, actualHttpsPort); } if (actualPort != options.getPort()) { // Override quarkus.http(s)?.(test-)?port @@ -1220,6 +1222,12 @@ public void handle(AsyncResult event) { } } + + private static void validateHttpPorts(int httpPort, int httpsPort) { + if (httpsPort == httpPort) { + throw new IllegalArgumentException("Both http and https servers started on port " + httpPort); + } + } }); }