You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Colm O hEigeartaigh (Jira)" <ji...@apache.org> on 2019/08/30 13:53:00 UTC

[jira] [Commented] (CXF-8104) Can't assign keystore and truststore before connecting

    [ https://issues.apache.org/jira/browse/CXF-8104?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16919567#comment-16919567 ] 

Colm O hEigeartaigh commented on CXF-8104:
------------------------------------------

Do you have a sample project we can use to reproduce the issue? CXF 2.3.11 is very old, please use a more up-to-date version of the library.

> 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)