Merge branch '1.5.x'

This commit is contained in:
Andy Wilkinson
2017-06-07 14:02:46 +01:00
2 changed files with 12 additions and 1 deletions

View File

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

View File

@@ -561,6 +561,17 @@ public class EndpointWebMvcAutoConfigurationTests {
this.applicationContext.refresh();
}
@Test
public void samePortCanBeUsedWhenManagementSslIsExplicitlyDisabled()
throws Exception {
TestPropertyValues.of("management.ssl.enabled=false")
.applyTo(this.applicationContext);
this.applicationContext.register(RootConfig.class, EndpointConfig.class,
BaseConfiguration.class, EndpointWebMvcAutoConfiguration.class,
ErrorMvcAutoConfiguration.class);
this.applicationContext.refresh();
}
@Test
public void managementServerCanDisableSslWhenUsingADifferentPort() throws Exception {
TestPropertyValues.of("management.port=" + ports.get().management,