mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-08-29 03:06:45 +08:00
Polish CF management skip SSL opt-in
See gh-7629 See gh-7655
This commit is contained in:
parent
34712cbf76
commit
dba8ef2ba8
@ -30,6 +30,7 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnCloudPlatform;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.boot.autoconfigure.security.IgnoredRequestCustomizer;
|
||||
import org.springframework.boot.bind.RelaxedPropertyResolver;
|
||||
import org.springframework.boot.cloud.CloudPlatform;
|
||||
import org.springframework.boot.web.client.RestTemplateBuilder;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
@ -83,9 +84,11 @@ public class CloudFoundryActuatorAutoConfiguration {
|
||||
|
||||
private CloudFoundrySecurityService getCloudFoundrySecurityService(
|
||||
RestTemplateBuilder restTemplateBuilder, Environment environment) {
|
||||
RelaxedPropertyResolver cloudFoundryProperties = new RelaxedPropertyResolver(
|
||||
environment, "management.cloudfoundry.");
|
||||
String cloudControllerUrl = environment.getProperty("vcap.application.cf_api");
|
||||
boolean skipSslValidation = Boolean.parseBoolean(
|
||||
environment.getProperty("management.cloudfoundry.skipSslValidation"));
|
||||
boolean skipSslValidation = cloudFoundryProperties
|
||||
.getProperty("skip-ssl-validation", Boolean.class, false);
|
||||
return cloudControllerUrl == null ? null
|
||||
: new CloudFoundrySecurityService(restTemplateBuilder, cloudControllerUrl,
|
||||
skipSslValidation);
|
||||
|
Loading…
Reference in New Issue
Block a user