spring-cloud / spring-cloud-vault

Configuration Integration with HashiCorp Vault
http://cloud.spring.io/spring-cloud-vault/
Apache License 2.0
273 stars 152 forks source link

Read the SSL Trust Store Password from file #526

Closed dawidek88 closed 3 years ago

dawidek88 commented 3 years ago

SSL Client Config - Read truststore password from a file Spring Cloud Vault Version: 2.2.5-RELEASE

I want to read the truststore password from a file in the SSL configuration of the vault client. But I haven't found any documentation about it. Can someone help me in this case? Or is it only possible as a string?

spring.cloud.vault: ssl: trust-store-password: changeit

Thanks in advance

mp911de commented 3 years ago

Store your password in a properties/yml file and you should be good. Using profiles is a fine way out.

dawidek88 commented 3 years ago

Thanks for the information. But in my case I have to read the password from a file.

mp911de commented 3 years ago

Starting your application with -Dspring.cloud.vault.ssl.trust-store-password=$(cat /path/to/your/password/file) should do the trick. Newer Spring Boot versions (2.4) allow imports of a config tree (-Dspring.config.imports=configtree:/path/to/password/files, then, naming your config file spring.cloud.vault.ssl.trust-store-password will result in the same).