Re: HTTP4s handshake exception

2019-03-30 Thread Rohan Emmanuel
i tried adding # for the parameters, it didn't help. can you point me to
any HTTPS sample . that would be helpful

On Fri, Mar 29, 2019 at 6:14 PM Andrea Cosentino
 wrote:

> You need to use the # for the parameter like this:
>
>
>  
> .to("https4://:/MutualAuthentication/MutuallySecuredServlet?sslContextParameters=#sslContextParameters");
>
> --
> Andrea Cosentino
> --
> Apache Camel PMC Chair
> Apache Karaf Committer
> Apache Servicemix PMC Member
> Email: ancosen1...@yahoo.com
> Twitter: @oscerd2
> Github: oscerd
>
>
>
>
>
>
> On Friday, March 29, 2019, 1:20:47 PM GMT+1, Rohan Emmanuel <
> rohan.emmanue...@gmail.com> wrote:
>
>
>
>
>
> The full route is as follows
>
>RouteBuilder routeBuilder = new RouteBuilder() {
> @Override
> public void configure() throws Exception {
> from("netty4:tcp://127.0.0.1:9992?allowDefaultCodec=false
> ")
> .setHeader(Exchange.HTTP_METHOD, constant(HttpMethods.GET))
>
> .to("https4://:/MutualAuthentication/MutuallySecuredServlet?sslContextParameters=sslContextParameters");
> }
> };
>
> On Fri, Mar 29, 2019 at 5:43 PM Andrea Cosentino
>  wrote:
> > Can you show the full route?
> >
> > --
> > Andrea Cosentino
> > --
> > Apache Camel PMC Chair
> > Apache Karaf Committer
> > Apache Servicemix PMC Member
> > Email: ancosen1...@yahoo.com
> > Twitter: @oscerd2
> > Github: oscerd
> >
> >
> >
> >
> >
> >
> > On Friday, March 29, 2019, 1:02:08 PM GMT+1, Rohan Emmanuel <
> rohan.emmanue...@gmail.com> wrote:
> >
> >
> >
> >
> >
> > Thanks for the response Andrea,
> >
> > i do have set the sslContextParameters as follows, do you see anything
> wrong with it?
> >
> >
> > ksp.setResource("C:\\gateway\\conf\\server.keystore");
> > ksp.setType("pkcs12");
> > ksp.setPassword("changeit");
> >
> > KeyManagersParameters kmp = new KeyManagersParameters();
> > kmp.setKeyStore(ksp);
> > kmp.setKeyPassword("changeit");
> >
> > TrustManagersParameters tmp = new TrustManagersParameters();
> > tmp.setKeyStore(ksp);
> >
> > SSLContextParameters scp = new SSLContextParameters();
> >
> >
> >
> > scp.setKeyManagers(kmp);
> > scp.setTrustManagers(tmp);
> >
> > JndiRegistry reg = new JndiRegistry(new JndiContext());
> >
> > reg.bind("sslContextParameters",scp);
> >
> > CamelContext context = new DefaultCamelContext(reg);
> >   routeBuilder.addRoutesToCamelContext(context);
> >  context.start();
> >
> >
> >
> > On Fri, Mar 29, 2019 at 5:14 PM Andrea Cosentino
>  wrote:
> >> You need to set the sslContextParameters on your uri.
> >>
> >>
> https://github.com/apache/camel/blob/master/components/camel-http4/src/main/docs/http4-component.adoc
> >>
> >> --
> >> Andrea Cosentino
> >> --
> >> Apache Camel PMC Chair
> >> Apache Karaf Committer
> >> Apache Servicemix PMC Member
> >> Email: ancosen1...@yahoo.com
> >> Twitter: @oscerd2
> >> Github: oscerd
> >>
> >>
> >>
> >>
> >>
> >>
> >> On Friday, March 29, 2019, 12:40:18 PM GMT+1, Rohan Emmanuel <
> rohan.emmanue...@gmail.com> wrote:
> >>
> >>
> >>
> >>
> >>
> >> hi ,
> >> I am trying to establish HTTPS connection to webserver in a route(
> running
> >> as standalone java application). but i am getting handshake exception
> can
> >> you please point me in the right direction?
> >>
> >> any http4s sample which i can use?
> >>
> >> below is the stack trace.
> >> 1.)I imported the client key store in browser and i am able to connect
> to
> >> the webserver to invoke the web application.
> >> 2.) when i try to connect to the same applciation in route, i get the
> below
> >> exception.
> >>
> >>
> >>
> >> Message History
> >>
> ---
> >> RouteId  ProcessorId  Processor
> >> Elapsed (ms)
> >> [route1] [route1] [tcp://127.0.0.1:9992
> >>   ] [  1253]
> >> [route1] [setHeader1] [setHeader[CamelHttpMethod]
> >>   ] [10]
> >> [route1] [to1  ] [https4://
> >> 15.213.85.104:3110/MutualAuthentication/MutuallySecuredServlet?sslCon]
> [
> >>   1228]
> >>
> >> Stacktrace
> >>
> ---
> >> javax.net.ssl.SSLHandshakeException: Remote host closed connection
> during
> >> handshake
> >> at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:992)
> >> ~[?:1.8.0_101]
> >> at
> >>
> sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1375)
> >> ~[?:1.8.0_101]
> >> at
> sun.security.ssl.S

private void configureSslForHttp4(){ KeyStoreParameters ksp = new KeyStoreParameters(); ksp.setResource(keystoreLocation); ksp.setPassword(keystorePassword); TrustManagersParameters tmp = new TrustMan

2019-03-30 Thread Wang Yan
You could do something like this to set SSL for Http4

private void configureSslForHttp4(){
KeyStoreParameters ksp = new KeyStoreParameters();
ksp.setResource(keystoreLocation);
ksp.setPassword(keystorePassword);
TrustManagersParameters tmp = new TrustManagersParameters();
tmp.setKeyStore(ksp);
SSLContextParameters scp = new SSLContextParameters();
scp.setTrustManagers(tmp);
HttpComponent httpComponent = getContext().getComponent("https4",
HttpComponent.class);
httpComponent.setSslContextParameters(scp);
}


HTTP4s handshake exception

2019-03-30 Thread Wang Yan
You could do something like this to set SSL for Http4

private void configureSslForHttp4(){
KeyStoreParameters ksp = new KeyStoreParameters();
ksp.setResource(keystoreLocation);
ksp.setPassword(keystorePassword);
TrustManagersParameters tmp = new TrustManagersParameters();
tmp.setKeyStore(ksp);
SSLContextParameters scp = new SSLContextParameters();
scp.setTrustManagers(tmp);
HttpComponent httpComponent = getContext().getComponent("https4",
HttpComponent.class);
httpComponent.setSslContextParameters(scp);
}


--
If you reply to this email, your message will be added to the discussion
below:
http://camel.465427.n5.nabble.com/private-void-configureSslForHttp4-KeyStoreParameters-ksp-new-KeyStoreParameters-ksp-setResource-keys-tp5832522.html
To unsubscribe from Camel - Users, click here

.
NAML



Re: using camel as proxy to download wsdl file from remote webservice

2019-03-30 Thread Willem Jiang
Hi,


It looks like you just want to proxy the request? using camel-http
component with bridgeEndpoint option is true should do the trick.
Not sure if it relates to basic authentication on the remote host.


Willem Jiang

Twitter: willemjiang
Weibo: 姜宁willem

On Sat, Mar 30, 2019 at 2:05 PM Wang Yan  wrote:
>
> I found the solution. it works for me, if you have better way, feel free to
> share 
>
> private String proxy(String url) throws IOException {
> CredentialsProvider provider = new BasicCredentialsProvider();
> UsernamePasswordCredentials credentials = new
> UsernamePasswordCredentials("USERNAME", "PASSWORD");
> provider.setCredentials(AuthScope.ANY, credentials);
> try (CloseableHttpClient httpClient =
> HttpClientBuilder.create().setDefaultCredentialsProvider(provider)
> .build();) {
> HttpGet request = new HttpGet(url);
> HttpResponse response = httpClient.execute(request);
> BufferedReader rd = new BufferedReader(new
> InputStreamReader(response.getEntity().getContent()));
> StringBuffer body = new StringBuffer();
> String line = "";
> while ((line = rd.readLine()) != null) {
> body.append(line + System.lineSeparator());
> }
> return body.toString();
> }
> }
>
>
> @Override
> public void configure() throws Exception {
> from("jetty:http://0.0.0.0:8080/myapp?matchOnUriPrefix=true
> ").routeId("webserviceproxyroute")
> .process(exchange -> {
> exchange.getOut()
> .setBody(proxy("http://remotehost/webservice?wsdl";));
> }).log(LoggingLevel.INFO, "Response  \n ${body}");
> }
>
>
> I used below code as proxy to download wsdl file from remote webservice,
> but it does not work. only get html back instead of wsdl file
>
>
>   
> 
>  uri="http://realserverhostname:8090/webservice?wsdl&bridgeEndpoint=true&throwExceptionOnFailure=false"/>
>   
>
>
>
> Ps:
>
>
>
> Of couse using browser I am able to open
> http://realserverhostname:8090/webservice?wsdl as wsdl file
>
> via camel route It only got something like below
>  Mocked Interfaces in project  href="/xxx?WSDL&interface=xxx">xxx href="/xxx?WSDL&interfacexxx">xxx
>
>
> Any hints or ideas?


Re: HTTP4s handshake exception

2019-03-30 Thread Rohan Emmanuel
still getting Handshake exception:]
not sure where i am going wrong

java.net.SocketException: Software caused connection abort: recv failed
at java.net.SocketInputStream.socketRead0(Native Method) ~[?:1.8.0_101]
at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
~[?:1.8.0_101]
at java.net.SocketInputStream.read(SocketInputStream.java:170)
~[?:1.8.0_101]
at java.net.SocketInputStream.read(SocketInputStream.java:141)
~[?:1.8.0_101]
at sun.security.ssl.InputRecord.readFully(InputRecord.java:465)
~[?:1.8.0_101]
at sun.security.ssl.InputRecord.read(InputRecord.java:503) ~[?:1.8.0_101]
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:973)
~[?:1.8.0_101]
at
sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1375)
~[?:1.8.0_101]
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1403)
~[?:1.8.0_101]
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1387)
~[?:1.8.0_101]

On Sat, Mar 30, 2019 at 2:28 PM Wang Yan  wrote:

> You could do something like this to set SSL for Http4
>
> private void configureSslForHttp4(){
> KeyStoreParameters ksp = new KeyStoreParameters();
> ksp.setResource(keystoreLocation);
> ksp.setPassword(keystorePassword);
> TrustManagersParameters tmp = new TrustManagersParameters();
> tmp.setKeyStore(ksp);
> SSLContextParameters scp = new SSLContextParameters();
> scp.setTrustManagers(tmp);
> HttpComponent httpComponent = getContext().getComponent("https4",
> HttpComponent.class);
> httpComponent.setSslContextParameters(scp);
> }
>
>
> --
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://camel.465427.n5.nabble.com/private-void-configureSslForHttp4-KeyStoreParameters-ksp-new-KeyStoreParameters-ksp-setResource-keys-tp5832522.html
> To unsubscribe from Camel - Users, click here
> <
> http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=465428&code=d3lhbmJveEBnbWFpbC5jb218NDY1NDI4fDExNTUzMDM4Mw==
> >
> .
> NAML
> <
> http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> >
>


-- 
Regards,
Rohan Emmanuel


Fwd: using camel as proxy to download wsdl file from remote webservice

2019-03-30 Thread Wang Yan
i thought the same, i tried with camel-http , camel-http4, jetty, with
setting bridgeEndpoint=true

,
set Basic Authorization in header
but it does not work with my remote wsdl , no idea why.
-- Forwarded message -
From: Willem.Jiang [via Camel] 
Date: Sat, Mar 30, 2019 at 10:46 AM
Subject: Re: using camel as proxy to download wsdl file from remote
webservice
To: W.Y 


Hi,


It looks like you just want to proxy the request? using camel-http
component with bridgeEndpoint option is true should do the trick.
Not sure if it relates to basic authentication on the remote host.


Willem Jiang

Twitter: willemjiang
Weibo: 姜宁willem

On Sat, Mar 30, 2019 at 2:05 PM Wang Yan <[hidden email]
> wrote:

>
> I found the solution. it works for me, if you have better way, feel free
to
> share 
>
> private String proxy(String url) throws IOException {
> CredentialsProvider provider = new BasicCredentialsProvider();
> UsernamePasswordCredentials credentials = new
> UsernamePasswordCredentials("USERNAME", "PASSWORD");
> provider.setCredentials(AuthScope.ANY, credentials);
> try (CloseableHttpClient httpClient =
> HttpClientBuilder.create().setDefaultCredentialsProvider(provider)
> .build();) {
> HttpGet request = new HttpGet(url);
> HttpResponse response = httpClient.execute(request);
> BufferedReader rd = new BufferedReader(new
> InputStreamReader(response.getEntity().getContent()));
> StringBuffer body = new StringBuffer();
> String line = "";
> while ((line = rd.readLine()) != null) {
> body.append(line + System.lineSeparator());
> }
> return body.toString();
> }
> }
>
>
> @Override
> public void configure() throws Exception {
> from("jetty:http://0.0.0.0:8080/myapp?matchOnUriPrefix=true
> ").routeId("webserviceproxyroute")
> .process(exchange -> {
> exchange.getOut()
> .setBody(proxy("http://remotehost/webservice?wsdl";));
> }).log(LoggingLevel.INFO, "Response  \n ${body}");
> }
>
>
> I used below code as proxy to download wsdl file from remote webservice,
> but it does not work. only get html back instead of wsdl file
>
>
>   
> 
> http://realserverhostname:8090/webservice?wsdl&bridgeEndpoint=true&throwExceptionOnFailure=false
"/>

>   
>
>
>
> Ps:
>
>
>
> Of couse using browser I am able to open
> http://realserverhostname:8090/webservice?wsdl as wsdl file
>
> via camel route It only got something like below
>  Mocked Interfaces in project  href="/xxx?WSDL&interface=xxx">xxx href="/xxx?WSDL&interfacexxx">xxx
>
>
> Any hints or ideas?


--
If you reply to this email, your message will be added to the discussion
below:
http://camel.465427.n5.nabble.com/using-camel-as-proxy-to-download-wsdl-file-from-remote-webservice-tp5832511p5832524.html
To unsubscribe from using camel as proxy to download wsdl file from remote
webservice, click here

.
NAML



Re: using camel as proxy to download wsdl file from remote webservice

2019-03-30 Thread Willem Jiang
Can you use sniffer tool to check http request? Maybe something is
wrong with the http header.

Willem Jiang

Twitter: willemjiang
Weibo: 姜宁willem

On Sat, Mar 30, 2019 at 6:04 PM Wang Yan  wrote:
>
> i thought the same, i tried with camel-http , camel-http4, jetty, with
> setting bridgeEndpoint=true
> 
> ,
> set Basic Authorization in header
> but it does not work with my remote wsdl , no idea why.
> -- Forwarded message -
> From: Willem.Jiang [via Camel] 
> Date: Sat, Mar 30, 2019 at 10:46 AM
> Subject: Re: using camel as proxy to download wsdl file from remote
> webservice
> To: W.Y 
>
>
> Hi,
>
>
> It looks like you just want to proxy the request? using camel-http
> component with bridgeEndpoint option is true should do the trick.
> Not sure if it relates to basic authentication on the remote host.
>
>
> Willem Jiang
>
> Twitter: willemjiang
> Weibo: 姜宁willem
>
> On Sat, Mar 30, 2019 at 2:05 PM Wang Yan <[hidden email]
> > wrote:
>
> >
> > I found the solution. it works for me, if you have better way, feel free
> to
> > share 
> >
> > private String proxy(String url) throws IOException {
> > CredentialsProvider provider = new BasicCredentialsProvider();
> > UsernamePasswordCredentials credentials = new
> > UsernamePasswordCredentials("USERNAME", "PASSWORD");
> > provider.setCredentials(AuthScope.ANY, credentials);
> > try (CloseableHttpClient httpClient =
> > HttpClientBuilder.create().setDefaultCredentialsProvider(provider)
> > .build();) {
> > HttpGet request = new HttpGet(url);
> > HttpResponse response = httpClient.execute(request);
> > BufferedReader rd = new BufferedReader(new
> > InputStreamReader(response.getEntity().getContent()));
> > StringBuffer body = new StringBuffer();
> > String line = "";
> > while ((line = rd.readLine()) != null) {
> > body.append(line + System.lineSeparator());
> > }
> > return body.toString();
> > }
> > }
> >
> >
> > @Override
> > public void configure() throws Exception {
> > from("jetty:http://0.0.0.0:8080/myapp?matchOnUriPrefix=true
> > ").routeId("webserviceproxyroute")
> > .process(exchange -> {
> > exchange.getOut()
> > .setBody(proxy("http://remotehost/webservice?wsdl";));
> > }).log(LoggingLevel.INFO, "Response  \n ${body}");
> > }
> >
> >
> > I used below code as proxy to download wsdl file from remote webservice,
> > but it does not work. only get html back instead of wsdl file
> >
> >
> >   
> > 
> > http://realserverhostname:8090/webservice?wsdl&bridgeEndpoint=true&throwExceptionOnFailure=false
> "/>
>
> >   
> >
> >
> >
> > Ps:
> >
> >
> >
> > Of couse using browser I am able to open
> > http://realserverhostname:8090/webservice?wsdl as wsdl file
> >
> > via camel route It only got something like below
> >  Mocked Interfaces in project  > href="/xxx?WSDL&interface=xxx">xxx > href="/xxx?WSDL&interfacexxx">xxx
> >
> >
> > Any hints or ideas?
>
>
> --
> If you reply to this email, your message will be added to the discussion
> below:
> http://camel.465427.n5.nabble.com/using-camel-as-proxy-to-download-wsdl-file-from-remote-webservice-tp5832511p5832524.html
> To unsubscribe from using camel as proxy to download wsdl file from remote
> webservice, click here
> 
> .
> NAML
> 


Re: HTTP4s handshake exception

2019-03-30 Thread Rohan Emmanuel
Can anyone point me to working HTTPS sample please?


On Sat, Mar 30, 2019 at 3:32 PM Rohan Emmanuel 
wrote:

> still getting Handshake exception:]
> not sure where i am going wrong
>
> java.net.SocketException: Software caused connection abort: recv failed
> at java.net.SocketInputStream.socketRead0(Native Method) ~[?:1.8.0_101]
> at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
> ~[?:1.8.0_101]
> at java.net.SocketInputStream.read(SocketInputStream.java:170)
> ~[?:1.8.0_101]
> at java.net.SocketInputStream.read(SocketInputStream.java:141)
> ~[?:1.8.0_101]
> at sun.security.ssl.InputRecord.readFully(InputRecord.java:465)
> ~[?:1.8.0_101]
> at sun.security.ssl.InputRecord.read(InputRecord.java:503) ~[?:1.8.0_101]
> at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:973)
> ~[?:1.8.0_101]
> at
> sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1375)
> ~[?:1.8.0_101]
> at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1403)
> ~[?:1.8.0_101]
> at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1387)
> ~[?:1.8.0_101]
>
> On Sat, Mar 30, 2019 at 2:28 PM Wang Yan  wrote:
>
>> You could do something like this to set SSL for Http4
>>
>> private void configureSslForHttp4(){
>> KeyStoreParameters ksp = new KeyStoreParameters();
>> ksp.setResource(keystoreLocation);
>> ksp.setPassword(keystorePassword);
>> TrustManagersParameters tmp = new TrustManagersParameters();
>> tmp.setKeyStore(ksp);
>> SSLContextParameters scp = new SSLContextParameters();
>> scp.setTrustManagers(tmp);
>> HttpComponent httpComponent = getContext().getComponent("https4",
>> HttpComponent.class);
>> httpComponent.setSslContextParameters(scp);
>> }
>>
>>
>> --
>> If you reply to this email, your message will be added to the discussion
>> below:
>>
>> http://camel.465427.n5.nabble.com/private-void-configureSslForHttp4-KeyStoreParameters-ksp-new-KeyStoreParameters-ksp-setResource-keys-tp5832522.html
>> To unsubscribe from Camel - Users, click here
>> <
>> http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=465428&code=d3lhbmJveEBnbWFpbC5jb218NDY1NDI4fDExNTUzMDM4Mw==
>> >
>> .
>> NAML
>> <
>> http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
>> >
>>
>
>
> --
> Regards,
> Rohan Emmanuel
>


-- 
Regards,
Rohan Emmanuel


Re: HTTP4s handshake exception

2019-03-30 Thread Rohan Emmanuel
while using the HTTPs4 producer, should i configure the "server.keystore"
as resource for the KeyStoreParameters?
 following this link to create the keystores-->
https://libraries.io/github/girirajsharma/wildfly-ssl-examples


On Sat, Mar 30, 2019 at 1:38 PM Rohan Emmanuel 
wrote:

> i tried adding # for the parameters, it didn't help. can you point me to
> any HTTPS sample . that would be helpful
>
> On Fri, Mar 29, 2019 at 6:14 PM Andrea Cosentino
>  wrote:
>
>> You need to use the # for the parameter like this:
>>
>>
>>  
>> .to("https4://:/MutualAuthentication/MutuallySecuredServlet?sslContextParameters=#sslContextParameters");
>>
>> --
>> Andrea Cosentino
>> --
>> Apache Camel PMC Chair
>> Apache Karaf Committer
>> Apache Servicemix PMC Member
>> Email: ancosen1...@yahoo.com
>> Twitter: @oscerd2
>> Github: oscerd
>>
>>
>>
>>
>>
>>
>> On Friday, March 29, 2019, 1:20:47 PM GMT+1, Rohan Emmanuel <
>> rohan.emmanue...@gmail.com> wrote:
>>
>>
>>
>>
>>
>> The full route is as follows
>>
>>RouteBuilder routeBuilder = new RouteBuilder() {
>> @Override
>> public void configure() throws Exception {
>> from("netty4:tcp://127.0.0.1:9992?allowDefaultCodec=false
>> ")
>> .setHeader(Exchange.HTTP_METHOD,
>> constant(HttpMethods.GET))
>>
>> .to("https4://:/MutualAuthentication/MutuallySecuredServlet?sslContextParameters=sslContextParameters");
>> }
>> };
>>
>> On Fri, Mar 29, 2019 at 5:43 PM Andrea Cosentino
>>  wrote:
>> > Can you show the full route?
>> >
>> > --
>> > Andrea Cosentino
>> > --
>> > Apache Camel PMC Chair
>> > Apache Karaf Committer
>> > Apache Servicemix PMC Member
>> > Email: ancosen1...@yahoo.com
>> > Twitter: @oscerd2
>> > Github: oscerd
>> >
>> >
>> >
>> >
>> >
>> >
>> > On Friday, March 29, 2019, 1:02:08 PM GMT+1, Rohan Emmanuel <
>> rohan.emmanue...@gmail.com> wrote:
>> >
>> >
>> >
>> >
>> >
>> > Thanks for the response Andrea,
>> >
>> > i do have set the sslContextParameters as follows, do you see anything
>> wrong with it?
>> >
>> >
>> > ksp.setResource("C:\\gateway\\conf\\server.keystore");
>> > ksp.setType("pkcs12");
>> > ksp.setPassword("changeit");
>> >
>> > KeyManagersParameters kmp = new KeyManagersParameters();
>> > kmp.setKeyStore(ksp);
>> > kmp.setKeyPassword("changeit");
>> >
>> > TrustManagersParameters tmp = new TrustManagersParameters();
>> > tmp.setKeyStore(ksp);
>> >
>> > SSLContextParameters scp = new SSLContextParameters();
>> >
>> >
>> >
>> > scp.setKeyManagers(kmp);
>> > scp.setTrustManagers(tmp);
>> >
>> > JndiRegistry reg = new JndiRegistry(new JndiContext());
>> >
>> > reg.bind("sslContextParameters",scp);
>> >
>> > CamelContext context = new DefaultCamelContext(reg);
>> >   routeBuilder.addRoutesToCamelContext(context);
>> >  context.start();
>> >
>> >
>> >
>> > On Fri, Mar 29, 2019 at 5:14 PM Andrea Cosentino
>>  wrote:
>> >> You need to set the sslContextParameters on your uri.
>> >>
>> >>
>> https://github.com/apache/camel/blob/master/components/camel-http4/src/main/docs/http4-component.adoc
>> >>
>> >> --
>> >> Andrea Cosentino
>> >> --
>> >> Apache Camel PMC Chair
>> >> Apache Karaf Committer
>> >> Apache Servicemix PMC Member
>> >> Email: ancosen1...@yahoo.com
>> >> Twitter: @oscerd2
>> >> Github: oscerd
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >> On Friday, March 29, 2019, 12:40:18 PM GMT+1, Rohan Emmanuel <
>> rohan.emmanue...@gmail.com> wrote:
>> >>
>> >>
>> >>
>> >>
>> >>
>> >> hi ,
>> >> I am trying to establish HTTPS connection to webserver in a route(
>> running
>> >> as standalone java application). but i am getting handshake exception
>> can
>> >> you please point me in the right direction?
>> >>
>> >> any http4s sample which i can use?
>> >>
>> >> below is the stack trace.
>> >> 1.)I imported the client key store in browser and i am able to connect
>> to
>> >> the webserver to invoke the web application.
>> >> 2.) when i try to connect to the same applciation in route, i get the
>> below
>> >> exception.
>> >>
>> >>
>> >>
>> >> Message History
>> >>
>> ---
>> >> RouteId  ProcessorId  Processor
>> >> Elapsed (ms)
>> >> [route1] [route1] [tcp://127.0.0.1:9992
>> >>   ] [  1253]
>> >> [route1] [setHeader1] [setHeader[CamelHttpMethod]
>> >>   ] [10]
>> >> [route1] [to1  ] [https4://
>> >> 15.213.85.104:3110/MutualAuthentication/MutuallySecuredServlet?sslCon]
>> [
>> >>   1228]
>> >>
>> >> Stacktrace
>> >>
>> ---

Re: HTTP4s handshake exception

2019-03-30 Thread Rohan Emmanuel
any clues on the reasons for getting "java.net.SocketException: Software
caused connection abort: recv failed"
when using http4s?


On Sun, Mar 31, 2019 at 10:08 AM Rohan Emmanuel 
wrote:

> Can anyone point me to working HTTPS sample please?
>
>
> On Sat, Mar 30, 2019 at 3:32 PM Rohan Emmanuel 
> wrote:
>
>> still getting Handshake exception:]
>> not sure where i am going wrong
>>
>> java.net.SocketException: Software caused connection abort: recv failed
>> at java.net.SocketInputStream.socketRead0(Native Method) ~[?:1.8.0_101]
>> at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
>> ~[?:1.8.0_101]
>> at java.net.SocketInputStream.read(SocketInputStream.java:170)
>> ~[?:1.8.0_101]
>> at java.net.SocketInputStream.read(SocketInputStream.java:141)
>> ~[?:1.8.0_101]
>> at sun.security.ssl.InputRecord.readFully(InputRecord.java:465)
>> ~[?:1.8.0_101]
>> at sun.security.ssl.InputRecord.read(InputRecord.java:503) ~[?:1.8.0_101]
>> at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:973)
>> ~[?:1.8.0_101]
>> at
>> sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1375)
>> ~[?:1.8.0_101]
>> at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1403)
>> ~[?:1.8.0_101]
>> at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1387)
>> ~[?:1.8.0_101]
>>
>> On Sat, Mar 30, 2019 at 2:28 PM Wang Yan  wrote:
>>
>>> You could do something like this to set SSL for Http4
>>>
>>> private void configureSslForHttp4(){
>>> KeyStoreParameters ksp = new KeyStoreParameters();
>>> ksp.setResource(keystoreLocation);
>>> ksp.setPassword(keystorePassword);
>>> TrustManagersParameters tmp = new TrustManagersParameters();
>>> tmp.setKeyStore(ksp);
>>> SSLContextParameters scp = new SSLContextParameters();
>>> scp.setTrustManagers(tmp);
>>> HttpComponent httpComponent = getContext().getComponent("https4",
>>> HttpComponent.class);
>>> httpComponent.setSslContextParameters(scp);
>>> }
>>>
>>>
>>> --
>>> If you reply to this email, your message will be added to the discussion
>>> below:
>>>
>>> http://camel.465427.n5.nabble.com/private-void-configureSslForHttp4-KeyStoreParameters-ksp-new-KeyStoreParameters-ksp-setResource-keys-tp5832522.html
>>> To unsubscribe from Camel - Users, click here
>>> <
>>> http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=465428&code=d3lhbmJveEBnbWFpbC5jb218NDY1NDI4fDExNTUzMDM4Mw==
>>> >
>>> .
>>> NAML
>>> <
>>> http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
>>> >
>>>
>>
>>
>> --
>> Regards,
>> Rohan Emmanuel
>>
>
>
> --
> Regards,
> Rohan Emmanuel
>


-- 
Regards,
Rohan Emmanuel