Handle explicit disablement of management SSL correctly

Closes gh-9423
pull/9426/merge
Andy Wilkinson 8 years ago
parent 223b694d3a
commit 9579e95868

@ -163,7 +163,7 @@ public class EndpointWebMvcAutoConfiguration
}
if (managementPort == ManagementServerPort.SAME) {
if (new RelaxedPropertyResolver(this.applicationContext.getEnvironment(),
"management.ssl.").getProperty("enabled") != null) {
"management.ssl.").getProperty("enabled", Boolean.class, false)) {
throw new IllegalStateException(
"Management-specific SSL cannot be configured as the management "
+ "server is not listening on a separate port");

@ -558,6 +558,17 @@ public class EndpointWebMvcAutoConfigurationTests {
this.applicationContext.refresh();
}
@Test
public void samePortCanBeUsedWhenManagementSslIsExplicitlyDisabled()
throws Exception {
EnvironmentTestUtils.addEnvironment(this.applicationContext,
"management.ssl.enabled=false");
this.applicationContext.register(RootConfig.class, EndpointConfig.class,
BaseConfiguration.class, EndpointWebMvcAutoConfiguration.class,
ErrorMvcAutoConfiguration.class, ServerPortConfig.class);
this.applicationContext.refresh();
}
@Test
public void managementServerCanDisableSslWhenUsingADifferentPort() throws Exception {
EnvironmentTestUtils.addEnvironment(this.applicationContext,

Loading…
Cancel
Save