Hi Freeman:
I update cxf to 2.1.5 but I have same problem. To test this, I do like
following
soap -> servicemix cxf bc(with ws security + ssl) -> servicemix camel
-> servicemix cxf-bc- provider( ssl to external web service + Outbound
Interceptor) --> external web service.
In the Outbound Interceptor, I changed the conduit like this
public OutboundSslInterceptor() {
super(Phase.PRE_STREAM);
}
public void handleMessage(Message message) throws Fault {
System.out.println("start setting in ssl");
System.out.println(message.size());
MessageExchange me = message.get(MessageExchange.class);
HTTPConduit conduit = (org.apache.cxf.transport.http.HTTPConduit)
message
.getExchange().getConduit(message);
if (conduit != null) {
System.out.println("Setting conduit");
TLSClientParameters sslParams = new
TLSClientParameters();
sslParams.setDisableCNCheck(Boolean.TRUE);
sslParams
.setTrustManagers(new TrustManager[] {
new My509TrustManager() });
conduit.setTlsClientParameters(sslParams);
return;
}
System.out.println("Setting in ssl conduit is null");
}
From the debug information, I saw the camel send the soap message to
cxf provider, but I can not get conduit, it always null.
What is wrong? Did I set the interceptor in correct Phase?
Thanks
Ning
ning_sunrise wrote:
>
> Hi:
> I try do some flow like following soap-->servicemix cxf bc (with ws
> security) -->servicemix cxf-se->servicmeix cxf-bc-provider --> external
> web service.
>
> The connection between servicmeix cxf-bc-provider --> external web
> service is ssl.
> My problem is we can not handle the ssl by using java
> keystore/truststore file. We have to write our customize TrustManager, we
> want to add code like following before we sent out soap request to
> external ws.
>
> JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
> factory.setServiceClass(com.mycompany.Service.class);
> factory.setAddress(external ws url);
>
> Session.service = (com.mycompany.Service) factory.create();
>
> Client client = ClientProxy.getClient(Session.adc);
>
> HTTPConduit http = (HTTPConduit) client.getConduit();
>
> TLSClientParameters tls = new TLSClientParameters();
>
> tls.setDisableCNCheck(true);
>
> tls.setTrustManagers(new TrustManager[]{new MyCustomTrustManager()});
>
> http.setTlsClientParameters(tls);
>
> ............
>
> I can make the code work outside servicemix.
> Does anyone know how to do it in servicemix BC or a working around?
>
> Thanks
> Ning
>
>
>
--
View this message in context:
http://www.nabble.com/customize-cxf-provider-to-support--customize-Trust-Manager-tp23982015p24054562.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.