Skip to content

Commit 64a3cec

Browse files
committed
use CFEnv from application.properties
1 parent 9b58eae commit 64a3cec

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

src/main/resources/application.yaml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,25 @@ spring:
5757
on-profile: cloud
5858
data:
5959
mongodb:
60-
uri: ${vcap.services.mongodb-service.credentials.uri}
60+
#uri: ${vcap.services.mongodb-service.credentials.uri}
61+
#cassandra.contact-points=#{ cfEnv.findCredentialsByTag('cassandra').get('node_ips') }
62+
uri: #{ cfEnv.findCredentialsByTag('mongodb').get('uri')
63+
ssl:
64+
bundle:
65+
pem:
66+
mongodb-ssl-bundle:
67+
reload-on-update: false
68+
truststore:
69+
certificate: #{ cfEnv.findCredentialsByTag('mongodb').get('tlsCert') }
70+
private-key: #{ cfEnv.findCredentialsByTag('mongodb').get('tlsKey') }
71+
72+
73+
#certificate: ${VCAP_SERVICES[mongodb-service][0].credentials.tlsCert}
74+
#private-key: ${VCAP_SERVICES[mongodb-service][0].credentials.tlsKey}
75+
76+
# In application.properties format:
77+
# spring.ssl.bundle.pem.clientbundle.truststore.certificate=${VCAP_SERVICES[your-service-name][0].credentials.certificate}
78+
# spring.ssl.bundle.pem.clientbundle.truststore.private-key=${VCAP_SERVICES[your-service-name][0].credentials.private_key}
6179

6280
otel:
6381
traces:

0 commit comments

Comments
 (0)