You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by "parulmahajan.777@gmail.com" <pa...@gmail.com> on 2018/09/11 08:01:18 UTC

Re: SNI not sent when using CXF WebClient v3.1.7 in Java 8?

Hi Chris,

I have to set SNI hostname while making rest call using CXF client 3.1.2.
I'm not able to find any configuration for this. Can you please help me how
to set SNI name using CXF client. I'm able to do the same using HTTP client.



--
Sent from: http://cxf.547215.n5.nabble.com/cxf-user-f547216.html

Re: SNI not sent when using CXF WebClient v3.1.7 in Java 8?

Posted by Colm O hEigeartaigh <co...@apache.org>.
Could you try with a more up-to-date version of CXF?

Colm.

On Tue, Sep 11, 2018 at 1:53 PM parulmahajan.777@gmail.com <
parulmahajan.777@gmail.com> wrote:

> Hi Chris,
>
> I have to set SNI hostname while making rest call using CXF client 3.1.2.
> I'm not able to find any configuration for this. Can you please help me how
> to set SNI name using CXF client. I'm able to do the same using HTTP
> client.
>
>
>
> --
> Sent from: http://cxf.547215.n5.nabble.com/cxf-user-f547216.html
>


-- 
Colm O hEigeartaigh

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

Re: SNI not sent when using CXF WebClient v3.1.7 in Java 8?

Posted by Matthew Broadhead <ma...@nbmlaw.co.uk.INVALID>.
here is a gist containing the wrapper 
https://gist.github.com/chongma/608152be50bfe99a294bf420137f3b71 you 
will have to ignore the bits that relate to my project.

i checked and TomEE 7.0.5 uses cxf 3.1.15.  not sure if that version 
contains the fix?

On 11/09/18 16:09, Matthew Broadhead wrote:
> i created a wrapper around WebClient to solve this problem.  I have 
> not checked recently whether it is still necessary in TomEE 7.0.5
>
> // TODO this should not be necessary in java 9
>     // 
> http://cxf.547215.n5.nabble.com/Custom-SSLSocketFactory-td5741482.html
>     // 
> http://stackoverflow.com/questions/30817934/extended-server-name-sni-extension-not-sent-with-jdk1-8-0-but-send-with-jdk1-7
>     private void webClientSslSocket() {
>         HTTPConduit httpConduit = 
> WebClient.getConfig(webClient).getHttpConduit();
>         if (httpConduit.getTlsClientParameters() != null) {
> httpConduit.getTlsClientParameters().setSSLSocketFactory(new 
> SSLSocketFactoryFacade());
>         } else {
>             TLSClientParameters tlsCP = new TLSClientParameters();
>             tlsCP.setSSLSocketFactory(new SSLSocketFactoryFacade());
>             httpConduit.setTlsClientParameters(tlsCP);
>         }
>     }
>
> On 11/09/18 10:01, parulmahajan.777@gmail.com wrote:
>> Hi Chris,
>>
>> I have to set SNI hostname while making rest call using CXF client 
>> 3.1.2.
>> I'm not able to find any configuration for this. Can you please help 
>> me how
>> to set SNI name using CXF client. I'm able to do the same using HTTP 
>> client.
>>
>>
>>
>> -- 
>> Sent from: http://cxf.547215.n5.nabble.com/cxf-user-f547216.html
>


Re: SNI not sent when using CXF WebClient v3.1.7 in Java 8?

Posted by Matthew Broadhead <ma...@nbmlaw.co.uk.INVALID>.
i created a wrapper around WebClient to solve this problem.  I have not 
checked recently whether it is still necessary in TomEE 7.0.5

// TODO this should not be necessary in java 9
     // 
http://cxf.547215.n5.nabble.com/Custom-SSLSocketFactory-td5741482.html
     // 
http://stackoverflow.com/questions/30817934/extended-server-name-sni-extension-not-sent-with-jdk1-8-0-but-send-with-jdk1-7
     private void webClientSslSocket() {
         HTTPConduit httpConduit = 
WebClient.getConfig(webClient).getHttpConduit();
         if (httpConduit.getTlsClientParameters() != null) {
httpConduit.getTlsClientParameters().setSSLSocketFactory(new 
SSLSocketFactoryFacade());
         } else {
             TLSClientParameters tlsCP = new TLSClientParameters();
             tlsCP.setSSLSocketFactory(new SSLSocketFactoryFacade());
             httpConduit.setTlsClientParameters(tlsCP);
         }
     }

On 11/09/18 10:01, parulmahajan.777@gmail.com wrote:
> Hi Chris,
>
> I have to set SNI hostname while making rest call using CXF client 3.1.2.
> I'm not able to find any configuration for this. Can you please help me how
> to set SNI name using CXF client. I'm able to do the same using HTTP client.
>
>
>
> --
> Sent from: http://cxf.547215.n5.nabble.com/cxf-user-f547216.html