[
https://issues.apache.org/jira/browse/CXF-4741?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13548558#comment-13548558
]
Yaroslav Gnatyuk commented on CXF-4741:
---------------------------------------
You're right, I'm trying to debug it right now to see the exact content of
conduits collection. Basically what I'm doing is I have already generated SOAP
client (by means of cxf-codegen-plugin) and the URL in WSDL differs from the
one I'm actually calling. So for each call I'm getting a port and configuring
its conduit with URL, read timeout, connection timeout and TLS
{code}
Client client = ClientProxy.getClient(port);
client.getRequestContext().put(Message.ENDPOINT_ADDRESS, endpointUrl);
HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy();
httpClientPolicy.setConnectionTimeout(connectionTimeout);
httpClientPolicy.setReceiveTimeout(readTimeout);
HTTPConduit http = (HTTPConduit) client.getConduit();
http.setClient(httpClientPolicy);
try {
char[] password = keyStorePassword.toCharArray();
KeyStore keyStore = KeyStore.getInstance(keyStoreType);
keyStore.load(new
ClassPathResource(keyStoreLocation).getInputStream(), password);
KeyManagerFactory factory =
KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
factory.init(keyStore, password);
TLSClientParameters params = new TLSClientParameters();
params.setKeyManagers(factory.getKeyManagers());
http.setTlsClientParameters(params);
} catch (Exception e) {
throw new RuntimeException("Cannot build key managers", e);
}
{code}
But looks like when I'm actually doing a call it uses different conduit in
ClientImpl.doInvoke()
> Different conduits are used when configuring stub and sending actual message
> ----------------------------------------------------------------------------
>
> Key: CXF-4741
> URL: https://issues.apache.org/jira/browse/CXF-4741
> Project: CXF
> Issue Type: Bug
> Affects Versions: 2.6.2, 2.6.4
> Reporter: Yaroslav Gnatyuk
>
> I was trying to set TLS context as described here: [How to configure the
> HTTPConduit for the SOAP
> Client?|http://cxf.apache.org/docs/client-http-transport-including-ssl-support.html#ClientHTTPTransport%28includingSSLsupport%29-HowtoconfiguretheHTTPConduitfortheSOAPClient%3F]
> However it doesn't work in CXF 2.6.2 and 2.6.4 while it worked perfectly fine
> in 2.5.3
> When looking into the code (line numbers are for version 2.6.4) I discovered
> that during this configuration a new message is created and passed to conduit
> selector (in this case UpfrontConduitSelector) - ClientImpl.getConduit():846.
> New conduit is created, assigned to message and returned.
> However when I do an actual call, I get to ClientImpl.doInvoke():486 where
> another message is created. Later on prepare() is called on conduit selector
> at ClientImpl.prepareConduitSelector():850 but the message is different so
> another conduit is created.
> This results in my conduit config being disregarded and I'm getting
> SSLHandshakeException
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira