The problem here is that the service code is retrieving the WSDL over
https, and this happens before we have configured CXF with the HTTPS
keystores/truststores to use with the client.

You could either do one of the following things:

a) Just configure the TLS keys in spring as is the standard, they should
get picked up automatically for this case.
b) Copy the WSDL file locally and refer to it locally
c) Try moving the TrustManagerFactory code before the Service.create call
and try the following:

SSLContext sc = SSLContext.getInstance("TLS");
        sc.init(null, tmf.getTrustManagers(), null);


HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());

Colm.

On Mon, Jan 29, 2018 at 9:04 AM, Al Grant <[email protected]> wrote:

> So I changed the service to point to https endpoint by editing the
> SaleService:
>
> @WebServiceClient(name = "SalesService", targetNamespace =
> "urn:test.sales.com/schema/common", wsdlLocation =
> "https://sales.com.au/ISRService.svc?singleWsdl";)
> public class SalesService
>     extends Service
> {....
>
> I have also imported the server certificate and they have trusted mine. I
> have also imported a private key.
>
> When I try to connect there is a long stack trace, but the relevant parts:
>
> Caused by: sun.security.validator.ValidatorException: PKIX path building
> failed: sun.security.provider.certpath.SunCertPathBuilderException: unable
> to find valid certification path to requested target
>
> Caused by: javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR:
> Problem parsing 'https://sales.com.au/ISRService.svc?singleWsdl'.:
> javax.net.ssl.SSLHandshakeException:
> sun.security.validator.ValidatorException: PKIX path building failed:
> sun.security.provider.certpath.SunCertPathBuilderException: unable to find
> valid certification path to requested target
>
> Obviously an error with the certificates?
>
> If i list whats in truststore.jks I see 2 certs. Server and CAcert.
> keystore.jks has also two entries.
>
> What else can I check?
>
>
>
>
>
>
>
>
>
>
>
>
> --
> Sent from: http://cxf.547215.n5.nabble.com/cxf-user-f547216.html
>



-- 
Colm O hEigeartaigh

Talend Community Coder
http://coders.talend.com

Reply via email to