spring-projects / spring-vault

Provides familiar Spring abstractions for HashiCorp Vault
https://spring.io/projects/spring-vault
Apache License 2.0
283 stars 186 forks source link

Resource class path resource [etc/cf-instance-credentials/instance.crt] does not exist on PCF authentication #653

Closed AdhritMadhav closed 3 years ago

AdhritMadhav commented 3 years ago

using Pivotal CloudFoundry authentication with vault getting below error.

Note: I have ssh to other working container and verified could able to see the certification and key in the specified path.

Observation, For time being added the certificates to the class path under resources , I’m getting connected to the vault.

org.springframework.boot spring-boot-starter-parent 2.2.6.RELEASE org.springframework.cloud spring-cloud-starter-vault-config 3.0.2

vault: host: ** port: 443 scheme: https connection-timeout: 5000 read-timeout: 15000 authentication: PCF

pcf: role: poc pcf-path: pcf instance-certificate: /etc/cf-instance-credentials/instance.crt instance-key: /etc/cf-instance-credentials/instance.key

java.lang.IllegalArgumentException: Resource class path resource [etc/cf-instance-credentials/instance.crt] does not exist 2021-04-28T10:28:47.608-04:00 [APP/PROC/WEB/0] [OUT] at org.springframework.util.Assert.isTrue(Assert.java:136) 2021-04-28T10:28:47.608-04:00 [APP/PROC/WEB/0] [OUT] at org.springframework.vault.authentication.ResourceCredentialSupplier.(ResourceCredentialSupplier.java:71) 2021-04-28T10:28:47.608-04:00 [APP/PROC/WEB/0] [OUT] at org.springframework.cloud.vault.config.ClientAuthenticationFactory.pcfAuthentication(ClientAuthenticationFactory.java:440) 2021-04-28T10:28:47.608-04:00 [APP/PROC/WEB/0] [OUT] at org.springframework.cloud.vault.config.ClientAuthenticationFactory.createClientAuthentication(ClientAuthenticationFactory.java:140) 2021-04-28T10:28:47.608-04:00 [APP/PROC/WEB/0] [OUT] at org.springframework.cloud.vault.config.VaultBootstrapConfiguration.clientAuthentication(VaultBootstrapConfiguration.java:248) 2021-04-28T10:28:47.608-04:00 [APP/PROC/WEB/0] [OUT] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 2021-04-28T10:28:47.608-04:00 [APP/PROC/WEB/0] [OUT] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 2021-04-28T10:28:47.608-04:00 [APP/PROC/WEB/0] [OUT] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 2021-04-28T10:28:47.608-04:00 [APP/PROC/WEB/0] [OUT] at java.lang.reflect.Method.invoke(Method.java:498)

AdhritMadhav commented 3 years ago

closing it as it needs to be raised under spring cloud vault,