最好引用和存储Keystore.jks和trustStrore.jks,以便超出您的应用程序(WAR,JAR,EAR)。
是的,根据您的要求,您不需要直接使用ketstore 的 truststore.jks。 强>
您可以将它存储在GIT或其他一些Repo位置,并通过CloundFoundry从您的应用程序指向该位置。
将keystore.jks文件放入应用程序资源(src / main / resources)文件夹中。
Add the Truststore.jks path and it's password in the application.properties *client.ssl.trust-store = keystore.jks client.ssl.trust-password = pass*
现在从application.properties获取属性值
@value("${client.ssl.trust-password}") private String trustPassword @value("${client.ssl.trust-store}") private String trustStore Put the location with protocol details in manifest file like below : env: loglevel: DEBUG,APP JAVA_OPTS: -XX:+UseConcMarkSweepGC TRUSTSTORE_LOCATION: https://app-dcudeploytc:dcudeploytc@svninst1.uk.fid-intl.com:18080/svn/TAPP100367DC_API/trunk/dc-Member-Api/dc-Member-Api-web/src/main/resources/cacerts.jks and get it like: @value("${client.ssl.trust-password}") private String trustPassword @value("${TRUSTSTORE_LOCATION}") private String trustStore
你必须捆绑 的 keystore.jks 强> 文件与应用程序。请找到下面的步骤。
添加keystore.jks路径及其密码 的 application.properties 强>
client.ssl.trust-store = keystore.jks client.ssl.trust-password = pass
@value( “$ {client.ssl.trust密码}”) private String trustPassword @value( “$ {client.ssl.trust店}”) private String trustStore
现在初始化流动属性
System.setProperty(“javax.net.ssl.trustStore”,trustStore); System.setProperty( “javax.net.ssl.trustStorePassword中”,trustPassword);
最终推向PCF