Handle explicit disablement of management SSL correctly
Closes gh-9423
This commit is contained in:
parent
223b694d3a
commit
9579e95868
|
|
@ -163,7 +163,7 @@ public class EndpointWebMvcAutoConfiguration
|
||||||
}
|
}
|
||||||
if (managementPort == ManagementServerPort.SAME) {
|
if (managementPort == ManagementServerPort.SAME) {
|
||||||
if (new RelaxedPropertyResolver(this.applicationContext.getEnvironment(),
|
if (new RelaxedPropertyResolver(this.applicationContext.getEnvironment(),
|
||||||
"management.ssl.").getProperty("enabled") != null) {
|
"management.ssl.").getProperty("enabled", Boolean.class, false)) {
|
||||||
throw new IllegalStateException(
|
throw new IllegalStateException(
|
||||||
"Management-specific SSL cannot be configured as the management "
|
"Management-specific SSL cannot be configured as the management "
|
||||||
+ "server is not listening on a separate port");
|
+ "server is not listening on a separate port");
|
||||||
|
|
|
||||||
|
|
@ -558,6 +558,17 @@ public class EndpointWebMvcAutoConfigurationTests {
|
||||||
this.applicationContext.refresh();
|
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
|
@Test
|
||||||
public void managementServerCanDisableSslWhenUsingADifferentPort() throws Exception {
|
public void managementServerCanDisableSslWhenUsingADifferentPort() throws Exception {
|
||||||
EnvironmentTestUtils.addEnvironment(this.applicationContext,
|
EnvironmentTestUtils.addEnvironment(this.applicationContext,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue