通过spring来设置SSL的keystore和trust store

pass the keystore and trust store of the client and server as follows:

通过下面方法设置SSL的keystore和trust store, 注入环境变量

 

<bean id="trustStore" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
<property name="targetObject" value="#{@systemProperties}" />
<property name="targetMethod" value="putAll" />
<property name="arguments">
<props>
<prop key="javax.net.ssl.trustStore"><jks key location></prop>
<prop key="javax.net.ssl.keyStorePassword">password</prop>
</props>
</property>
</bean>
 
<bean id="keystore" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
<property name="targetObject" value="#{@systemProperties}" />
<property name="targetMethod" value="putAll" />
<property name="arguments">
<props>
<prop key="javax.net.ssl.keyStore"><jks key location></prop>
<prop key="javax.net.ssl.keyStorePassword">password</prop>
</props>
</property>
</bean>

 

你可能感兴趣的:(keystore)