Discussion:
WS CXF Proxy SSL Cert CN to use as WSSecurity username?
Stefan Norberg
2012-01-26 08:16:27 UTC
Permalink
Hi,
I have setup a CXF proxy config that uses HTTPS connector SSL client certificates on the receiving end.
I'm using standard Web Service Security on the outbound endpoint and would like to use the SSL client certificate CN (common name) as the username.

Any hints on how to accomplish that based on the below configuration would be very much appreciated.

Thanks,
Stefan

<?xml version="1.0" encoding="UTF-8"?>

<mule xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:https="http://www.mulesoft.org/schema/mule/https" ...">
<spring:beans>
<spring:bean id="clientCallback" name="Bean" class="ClientPasswordCallback" doc:name="clientPasswordCallback"/>
</spring:beans>

<https:connector name="httpsConnector" validateConnections="false" doc:name="httpsConnector">
<https:tls-key-store path="mykey.jks" keyPassword="pass" storePassword="pass"/>
<https:tls-server path="cacerts.jks" storePassword="trustme" *requireClientAuthentication="true*"/>
</https:connector>

<https:endpoint host="localhost" port="65081" name="clientEndpoint" connector-ref="httpsConnector" keep-alive="true" doc:name="httpsClientEndpoint"/>

<flow name="Sprouts-external" doc:name="Sprouts-external" processingStrategy="synchronous">
<inbound-endpoint address="https://localhost:65081/services/SproutsProxy" exchange-pattern="request-response" connector-ref="httpsConnector" doc:name="HTTP">
<cxf:proxy-service wsdlLocation="SproutsWebFacade.wsdl" mtomEnabled="true" service="SproutsWebFacade" namespace="http://facade.sprouts.pensionsmyndigheten.se/">
</cxf:proxy-service>
</inbound-endpoint>
<outbound-endpoint address="http://127.0.0.1:8090/sprouts/ws/SproutsWebFacade" doc:name="HTTP">
<cxf:proxy-client mtomEnabled="true">
<cxf:outInterceptors>
<spring:bean class="org.apache.cxf.binding.soap.saaj.SAAJOutInterceptor"/>
<spring:bean class="org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor">
<spring:constructor-arg>
<spring:map>
<spring:entry key="action" value="UsernameToken"/>
<spring:entry key="user" value="testuser"/>
<spring:entry key="passwordType" value="PasswordText"/>
<spring:entry key="passwordCallbackRef" value-ref="clientCallback"/>
</spring:map>
</spring:constructor-arg>
</spring:bean>
</cxf:outInterceptors>
</cxf:proxy-client>
</outbound-endpoint>
</flow>
</mule>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email
Stefan Norberg
2012-01-26 12:19:51 UTC
Permalink
It seems like Mule makes the certs available thorugh properties:
OUTBOUND scoped properties:
Content-Type=application/soap+xml; charset=UTF-8
LOCAL_CERTIFICATES=[Ljava.security.cert.X509Certificate;@a0b96a5
MULE_ENCODING=UTF-8
PEER_CERTIFICATES=[Ljava.security.cert.X509Certificate;@7ecf2fc9
http.method=POST

...

Any hints on how to proceed with setting the username in the cxf:proxy-client would be appreciated?

/Stefan

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email
stefano.falconetti
2012-01-26 12:22:19 UTC
Permalink
Thank you for your message. I'm sorry, I'm currently out of office with no access to e-mails. If your query is urgent you can try to contact me on my mobile: +39 335 1990013. I will be back on 27/02/2012 Regards, Stefano Falconetti.

If you are not the intended recipient of this e-mail message, please notify the sender
and delete all copies immediately. The sender believes this message and any attachments
were sent free of any virus, worm, Trojan horse, and other forms of malicious code.
This message and its attachments could have been infected during transmission. The
recipient opens any attachments at the recipient's own risk, and in so doing, the
recipient accepts full responsibility for such actions and agrees to take protective
and remedial action relating to any malicious code. Travelport is not liable for any
loss or damage arising from this message or its attachments.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Loading...