Skip to content

Commit

Permalink
Take into account TLS registry config for generating URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
gsmet committed Nov 23, 2024
1 parent 446da48 commit 3f7a194
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ public static String getManagementUrlPrefix(LaunchModeBuildItem mode) {
if (mode != null && mode.isTest()) {
managementPort = config.getOptionalValue("quarkus.management.test-port", Integer.class).orElse(9001);
}
var isHttps = isTLsConfigured(config);
var isHttps = isTlsConfigured(config);

return (isHttps ? "https://" : "http://") + managementHost + ":" + managementPort;
}
Expand Down Expand Up @@ -438,7 +438,15 @@ public Builder management(String managementConfigKey) {
* @param config the config
* @return {@code true} if the management interface configuration contains a key or a certificate (indicating TLS)
*/
private static boolean isTLsConfigured(Config config) {
private static boolean isTlsConfigured(Config config) {
// TLS registry
var hasTlsConfigurationName = config.getOptionalValue("quarkus.management.tls-configuration-name", String.class)
.isPresent();
if (hasTlsConfigurationName) {
return true;
}

// legacy TLS configuration
var hasCert = config.getOptionalValue("quarkus.management.ssl.certificate.file", String.class).isPresent();
var hasKey = config.getOptionalValue("quarkus.management.ssl.certificate.key-file", String.class).isPresent();

Expand Down

0 comments on commit 3f7a194

Please sign in to comment.