[
https://issues.apache.org/jira/browse/CXF-8104?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16921425#comment-16921425
]
Colm O hEigeartaigh commented on CXF-8104:
------------------------------------------
What is "ksl" in the above? Instead of setting the TLSClientParameters object
on the factory, instead you could try adding the following lines:
{code:java}
Client cxfClient = ClientProxy.getClient(client);
HTTPConduit http = (HTTPConduit) cxfClient.getConduit();
http.setTlsClientParameters(tlsParams);{code}
> Can't assign keystore and truststore before connecting
> ------------------------------------------------------
>
> Key: CXF-8104
> URL: https://issues.apache.org/jira/browse/CXF-8104
> Project: CXF
> Issue Type: Bug
> Affects Versions: 2.3.11
> Reporter: Daniel Schielzeth
> Priority: Critical
>
> I want to use a SOAP Provider with my java client. The Provider requires a
> Certificate (keystore and truststore). We have tried many ways to make sure
> the certificate is used for the client but it doesn't seem to work. I guess,
> the certificate is set too late. The best we could come up with is
> {code:java}
> KeyStore keyStore = KeyStore.getInstance(cert.getKeystore_type());
> keyStore.load(new FileInputStream(cert.getKeystore_file()),
> cert.getKeystore_password().toCharArray());
> KeyStore trustStore = KeyStore.getInstance(cert.getTruststore_type());
> trustStore.load(new FileInputStream(cert.getTruststore_file()),
> cert.getTruststore_password().toCharArray());
> SSLContext context = initSecurityContext(keyStore, trustStore,
> cert.getKeystore_password());
> SOAPService client = (ListBuyerRequestsReadServicePortType)
> ClientBuilder.newBuilder().register(SOAPService.class).sslContext(context).build();
> {code}
> We get a _javax.net.ssl.SSLHandshakeException: Received fatal alert:
> handshake_failure_ when assigning the client in the last line.
> Do you know how to do it?
--
This message was sent by Atlassian Jira
(v8.3.2#803003)