Spring integration Spring集成web服务客户端未为传出消息签名密钥
我目前正在使用SpringIntegrationWebServiceClient,它可以很好地用于带有http调用的web服务端点。 现在,我正试图通过签署客户端密钥来调用https端点,以发送带有来自cacerts(defaut)的服务器证书的消息。我们在cacerts中添加了服务器证书,并将身份验证密钥保存在单独的密钥存储文件中,以便为传出消息签名/添加密钥。它与来自cacerts的证书的绑定符合预期。对于使用服务器证书对传出消息签名/添加密钥,我在Spring Integration xml中添加了以下代码Spring integration Spring集成web服务客户端未为传出消息签名密钥,spring-integration,Spring Integration,我目前正在使用SpringIntegrationWebServiceClient,它可以很好地用于带有http调用的web服务端点。 现在,我正试图通过签署客户端密钥来调用https端点,以发送带有来自cacerts(defaut)的服务器证书的消息。我们在cacerts中添加了服务器证书,并将身份验证密钥保存在单独的密钥存储文件中,以便为传出消息签名/添加密钥。它与来自cacerts的证书的绑定符合预期。对于使用服务器证书对传出消息签名/添加密钥,我在Spring Integration xm
<bean id="keyStore" class="org.springframework.ws.soap.security.support.KeyStoreFactoryBean">
<property name="location">
<value>classpath:client.jks</value>
</property>
<property name="password" value="test123"/>
</bean>
<bean id="keyStoreHandler" class="org.springframework.ws.soap.security.xwss.callback.KeyStoreCallbackHandler">
<property name="keyStore" ref="keyStore"/>
<property name="privateKeyPassword" value="test123"/>
</bean>
<bean id="xshMessageFactory" class="org.springframework.ws.soap.axiom.AxiomSoapMessageFactory" />
<si:channel id="xshReqChannel" />
<si:channel id="xshResChannel" />
<si:gateway id="xshProvider" service-interface="comm.sd.xshProvider" default-request-channel="xshReqChannel" default-reply-channel="xshResChannel"
/>
<ws:outbound-gateway id="xshProvider"
marshaller="xshMarshaller"
unmarshaller="xshMarshaller"
message-sender="xshMessageSender"
message-factory="xshMessageFactory"
request-channel="xshReqChannel"
reply-channel="xshResChannel"
uri="${xshEndPoint}" />
<bean id="keyStore" class="org.springframework.ws.soap.security.support.KeyStoreFactoryBean">
<property name="location">
<value>classpath:client.jks</value>
</property>
<property name="password" value="test123"/>
</bean>
<bean id="keyStoreHandler" class="org.springframework.ws.soap.security.xwss.callback.KeyStoreCallbackHandler">
<property name="keyStore" ref="keyStore"/>
<property name="privateKeyPassword" value="test123" />
</bean>
</beans>
类路径:client.jks
添加上述代码后,身份验证密钥不会与出站网关消息绑定,也没有例外。请帮助我这里缺少什么。它需要添加/签署myown密钥库文件中的身份验证密钥以及服务器证书。我非常感谢你在这方面的意见
请参考我最后的Spring集成xml
<bean id="keyStore" class="org.springframework.ws.soap.security.support.KeyStoreFactoryBean">
<property name="location">
<value>classpath:client.jks</value>
</property>
<property name="password" value="test123"/>
</bean>
<bean id="keyStoreHandler" class="org.springframework.ws.soap.security.xwss.callback.KeyStoreCallbackHandler">
<property name="keyStore" ref="keyStore"/>
<property name="privateKeyPassword" value="test123"/>
</bean>
<bean id="xshMessageFactory" class="org.springframework.ws.soap.axiom.AxiomSoapMessageFactory" />
<si:channel id="xshReqChannel" />
<si:channel id="xshResChannel" />
<si:gateway id="xshProvider" service-interface="comm.sd.xshProvider" default-request-channel="xshReqChannel" default-reply-channel="xshResChannel"
/>
<ws:outbound-gateway id="xshProvider"
marshaller="xshMarshaller"
unmarshaller="xshMarshaller"
message-sender="xshMessageSender"
message-factory="xshMessageFactory"
request-channel="xshReqChannel"
reply-channel="xshResChannel"
uri="${xshEndPoint}" />
<bean id="keyStore" class="org.springframework.ws.soap.security.support.KeyStoreFactoryBean">
<property name="location">
<value>classpath:client.jks</value>
</property>
<property name="password" value="test123"/>
</bean>
<bean id="keyStoreHandler" class="org.springframework.ws.soap.security.xwss.callback.KeyStoreCallbackHandler">
<property name="keyStore" ref="keyStore"/>
<property name="privateKeyPassword" value="test123" />
</bean>
</beans>
类路径:client.jks
老实说,我从来没有做过类似的事情,但根据Spring WS,你走的路是正确的。您错过的只是XwsSecurityInterceptor
bean的配置,以及使用interceptor
属性将其注入
如果您能提供解决方案并与我们共享,将其添加到我们的解决方案中,那就太好了