问题描述
在我的spring boot应用程序中,我发出一个https(安全)请求。为此,我需要将流动参数作为JVM参数传递。
In my spring boot application I making a https(secure) request. For that I need pass flowing argument as JVM argument.
javax.net.ssl.trustStore
javax.net.ssl.trustStorePassword
javax.net.ssl.trustStorejavax.net.ssl.trustStorePassword
例如:
-Djavax.net.ssl.trustStore=~/home/dinusha/keystore.jks -Djavax.net.ssl.trustStorePassword=pass
在PCF(Cloud Foundry)中,我无法将keystore.jks文件复制到PCF。因此,如何在PCF上传递此值
In PCF (Cloud Foundry) I can not copy keystore.jks file to PCF. So how can I pass this values on PCF
推荐答案
您必须捆绑 keystore.jks 文件与应用程序。请在下面找到步骤。
You have to bundle the keystore.jks file with application. Please find the step bellow.
- 将keystore.jks文件放入应用程序资源(src / main / resources)文件夹中。
-
在 application.properties
现在从application.properties获取属性值
Now get the property value form application.properties
现在初始化流动属性
Now initialize flowing properties
最后推送到PCF
Finaly push to PCF
这篇关于在PCF(Cloud Foundry)上将SSL密钥库文件添加到Java可信存储区以进行HTTP客户端请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!