我正在尝试设置由Spring Cloud Vault秘密管理支持的Spring Cloud Config Server.我对Spring比较新,但我在这里尝试了以下说明和示例: -
http://cloud.spring.io/spring-cloud-vault-config/
如果您按照默认设置(如http,localhost和8200用于保险库端点)和tls_disable = 1来关闭SSL,则一切正常.然而,对于任何真实环境而言,这些都不是实用的设置,并且几乎没有任何示例可以帮助解决这 有人可以帮助一个有效的例子吗?
我已成功设置了启用TLS的保险库.我已成功设置一个使用自签名证书连接的配置服务器.我甚至可以将一个秘密值注入配置服务器并通过@Value和公开它@PostConstruct.
所有这些都有效.但是,当我尝试利用Spring Conig端点访问Vault时,我得到以下内容: -
{
"timestamp": 1486413850574,
"status": 500,
"error": "Internal Server Error",
"exception": "org.springframework.web.client.ResourceAccessException",
"message": "I/O error on GET request for \"http://127.0.0.1:8200/v1/secret/myapp\": Connection refused: connect; nested exception is java.net.ConnectException: Connection refused: connect",
"path": "/myapp/default"
}
Run Code Online (Sandbox Code Playgroud)
即使我在bootstrap.yml.中设置了覆盖,配置服务器也使用默认值.
server:
port: 8888
spring:
profiles:
active: vault
spring.cloud.vault:
host: myhost.mydomain.com
port: 8200
scheme: https
authentication: TOKEN
token: 0f1887c3-d8a8-befd-a5a2-01e4e066c50
ssl:
trust-store: configTrustStore.jks
trust-store-password: changeit
Run Code Online (Sandbox Code Playgroud)
正如您所看到的,它应该指向myhost.mydomain.com而不是127.0.0.1,它应该使用https,而不是http作为协议方案.
我不确定为什么它将这些默认值用于配置服务器端点,但在spring …