The "ServerCertX509TrustManager" part is custom to that test. Also if it's
2-way TLS you'll need to add a KeyManager with the client key. There are
some other examples in that module with tests that show how to do that.

Colm.

On Fri, Jan 19, 2018 at 12:18 PM, Al Grant <[email protected]> wrote:

> Ok, so at first glance it looks like I already have my client setup. They
> key
> bits I am guessing are:
>
> 1. Import certs - it will be mutual TLS
>
> 2. I already have :
>
>         org.apache.cxf.endpoint.Client client =
> org.apache.cxf.frontend.ClientProxy.getClient(iisrService);
>         org.apache.cxf.endpoint.Endpoint cxfEndpoint =
> client.getEndpoint();
>
> 2a. Add:
>
>         // Setup TLS client params
>         TLSClientParameters tlsParams = new TLSClientParameters();
>         X509TrustManager trustManager =
>             new ServerCertX509TrustManager(validPrincipalName);
>         TrustManager[] trustManagers = new TrustManager[1];
>         trustManagers[0] = trustManager;
>         tlsParams.setTrustManagers(trustManagers);
>         tlsParams.setDisableCNCheck(true);
>
>         // Client client = ClientProxy.getClient(port); <- removed as
> instantiated above
>         HTTPConduit http = (HTTPConduit) client.getConduit();
>         http.setTlsClientParameters(tlsParams);
>
> 3. Send request as before.
>
> Cheers
>
>
>
>
> --
> 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