Re: Regarding HTTP2 support for classic 5.x httpclient

2022-11-19 Thread Oleg Kalnichevski
On Sat, 2022-11-19 at 23:53 +0530, sreenivas somavarapu wrote:
> Hi Oleg,
> 
> How can we force to use a different protocols for different requests
> using
> same httpclient object is what I am looking for until now but was
> unscuccessful in finding any examples or achieving it using async
> httpclient implementation.

Protocol version is a connection property and not a request property.
Protocol version on the message level is merely a hint.

Oleg



> 
> Input request is not in my control. It could be from a HTTP 2 enabled
> client or from non enabled  client as well. My server supports both
> protocols and now as my application is reverse proxy it should make
> sure
> that error is returned if that protocol is not supported by actual
> server
> and if supported response should be provided back.
> 
> This is the reason I was trying to control it with below option but
> httpclient is itself throwing error.
> 
> *AsyncRequestBuilder* APIs *setVersion* method by using
> *HttpVersion.HTTP_2*
> or  *HttpVersion.HTTP_2_0* argument request is failing with
> *Unsupported
> version* error for a https url.
> 
> Regards,
> Sreenivas
> 
> On Sat, Nov 19, 2022, 11:37 PM Oleg Kalnichevski 
> wrote:
> 
> > On Sat, 2022-11-19 at 23:22 +0530, sreenivas somavarapu wrote:
> > > Hi Oleg,
> > > 
> > > Yes if actual server doesn't support the request should fail. As
> > > conveyed
> > > earlier I am trying simple reverse proxy application for which
> > > requirement
> > > is end to end flow should use same protocol. My application gets
> > > request
> > > from users and my application should make sure that same protocol
> > > should be
> > > used as in request when getting the response from different
> > > servers
> > > using
> > > httpclient. So I was checking the feasibility in httpclient
> > > classic /
> > > async
> > > implementations to see if I could achieve that using same
> > > httpclient
> > > method.
> > > 
> > > Regards,
> > > Sreenivas
> > > 
> > 
> > I am still confused. If you do not want protocol negotiation, just
> > do
> > not use it. If can force the desired protocol version.
> > 
> > Oleg
> > 
> > 
> > > On Sat, Nov 19, 2022, 11:13 PM Oleg Kalnichevski
> > > 
> > > wrote:
> > > 
> > > > On Sat, 2022-11-19 at 23:10 +0530, sreenivas somavarapu wrote:
> > > > > Hi Oleg,
> > > > > 
> > > > > Thank you for your reply.
> > > > > 
> > > > > My simple use case is I want to control on which channel /
> > > > > protocol
> > > > > (HTTP 1.x or HTTP 2) the requests should use using async
> > > > > httpclient
> > > > > api implementation irrespective of backend server enablement
> > > > > of
> > > > > that
> > > > > respective protocol.
> > > > 
> > > > This makes no sense. If the opposite endpoint does not support
> > > > H2
> > > > HttpClient will not be able to execute request with that
> > > > protocol.
> > > > 
> > > > Oleg
> > > > 
> > > > 
> > > > 
> > > > 
> > > > > Regards,
> > > > > Sreenivas
> > > > > 
> > > > > On Sat, Nov 19, 2022, 3:47 PM Oleg Kalnichevski
> > > > > 
> > > > > wrote:
> > > > > > On Fri, 2022-11-18 at 13:45 +0530, sreenivas somavarapu
> > > > > > wrote:
> > > > > > > Hi Oleg,
> > > > > > > 
> > > > > > > Thank you for your reply and conformation.
> > > > > > > 
> > > > > > > I was looking at async APIs on how to achieve both HTTP
> > > > > > > 1.x
> > > > > > > and
> > > > > > > HTTP
> > > > > > > 2
> > > > > > > support using same HttpAsyncClients builder but initial
> > > > > > > glance at
> > > > > > > APIs
> > > > > > > looks like it is not possible. Is my understanding
> > > > > > > correct?
> > > > > > 
> > > > > > 
> > > > > > No, it is not.
> > > > > > 
> > > > > > 
> > > > > > >   Below are
> > > > > > > different types of configurations I have used. Please let
> > > > > > > me
> > > > > > > know
> > > > > > > if
> > > > > > > you
> > > > > > > need my complete sample code? For these tests I was using
> > > > > > > IIS
> > > > > > > server
> > > > > > > with
> > > > > > > HTTP2 enabled and as well as
> > > > > > > https://hc.apache.org website as
> > > > > > > well.
> > > > > > > 
> > > > > > > I am trying with *setVersionPolicy* method on
> > > > > > > *HttpAsyncClients*
> > > > > > > API
> > > > > > > and if
> > > > > > > use *NEGOTIATE* version policy then it is working fine.
> > > > > > > If I
> > > > > > > use
> > > > > > > any
> > > > > > > of
> > > > > > > *FORCE_HTTP_** version policy then I am getting *400 bad
> > > > > > > request*.
> > > > > > > 
> > > > > > > If I keep it as *NEGOTIATE* and then try to force HTTP2
> > > > > > > request
> > > > > > > using
> > > > > > > *AsyncRequestBuilder* APIs setVersion method bu using
> > > > > > > *HttpVersion.HTTP_2*
> > > > > > > or  *HttpVersion.HTTP_2_0* argument request is failing
> > > > > > > with
> > > > > > > *Unsupported
> > > > > > > version* error.
> > > > > > > 
> > > > > > > My usecase is I have a small web app which will be used
> > > > > > > by
> > > > > > > users
> > > > > > > to
> > > > > > > get
> > > > > > > 

Re: Regarding HTTP2 support for classic 5.x httpclient

2022-11-19 Thread sreenivas somavarapu
Hi Oleg,

How can we force to use a different protocols for different requests using
same httpclient object is what I am looking for until now but was
unscuccessful in finding any examples or achieving it using async
httpclient implementation.

Input request is not in my control. It could be from a HTTP 2 enabled
client or from non enabled  client as well. My server supports both
protocols and now as my application is reverse proxy it should make sure
that error is returned if that protocol is not supported by actual server
and if supported response should be provided back.

This is the reason I was trying to control it with below option but
httpclient is itself throwing error.

*AsyncRequestBuilder* APIs *setVersion* method by using *HttpVersion.HTTP_2*
or  *HttpVersion.HTTP_2_0* argument request is failing with *Unsupported
version* error for a https url.

Regards,
Sreenivas

On Sat, Nov 19, 2022, 11:37 PM Oleg Kalnichevski  wrote:

> On Sat, 2022-11-19 at 23:22 +0530, sreenivas somavarapu wrote:
> > Hi Oleg,
> >
> > Yes if actual server doesn't support the request should fail. As
> > conveyed
> > earlier I am trying simple reverse proxy application for which
> > requirement
> > is end to end flow should use same protocol. My application gets
> > request
> > from users and my application should make sure that same protocol
> > should be
> > used as in request when getting the response from different servers
> > using
> > httpclient. So I was checking the feasibility in httpclient classic /
> > async
> > implementations to see if I could achieve that using same httpclient
> > method.
> >
> > Regards,
> > Sreenivas
> >
>
> I am still confused. If you do not want protocol negotiation, just do
> not use it. If can force the desired protocol version.
>
> Oleg
>
>
> > On Sat, Nov 19, 2022, 11:13 PM Oleg Kalnichevski 
> > wrote:
> >
> > > On Sat, 2022-11-19 at 23:10 +0530, sreenivas somavarapu wrote:
> > > > Hi Oleg,
> > > >
> > > > Thank you for your reply.
> > > >
> > > > My simple use case is I want to control on which channel /
> > > > protocol
> > > > (HTTP 1.x or HTTP 2) the requests should use using async
> > > > httpclient
> > > > api implementation irrespective of backend server enablement of
> > > > that
> > > > respective protocol.
> > >
> > > This makes no sense. If the opposite endpoint does not support H2
> > > HttpClient will not be able to execute request with that protocol.
> > >
> > > Oleg
> > >
> > >
> > >
> > >
> > > > Regards,
> > > > Sreenivas
> > > >
> > > > On Sat, Nov 19, 2022, 3:47 PM Oleg Kalnichevski
> > > > 
> > > > wrote:
> > > > > On Fri, 2022-11-18 at 13:45 +0530, sreenivas somavarapu wrote:
> > > > > > Hi Oleg,
> > > > > >
> > > > > > Thank you for your reply and conformation.
> > > > > >
> > > > > > I was looking at async APIs on how to achieve both HTTP 1.x
> > > > > > and
> > > > > > HTTP
> > > > > > 2
> > > > > > support using same HttpAsyncClients builder but initial
> > > > > > glance at
> > > > > > APIs
> > > > > > looks like it is not possible. Is my understanding correct?
> > > > >
> > > > >
> > > > > No, it is not.
> > > > >
> > > > >
> > > > > >   Below are
> > > > > > different types of configurations I have used. Please let me
> > > > > > know
> > > > > > if
> > > > > > you
> > > > > > need my complete sample code? For these tests I was using IIS
> > > > > > server
> > > > > > with
> > > > > > HTTP2 enabled and as well as https://hc.apache.org website as
> > > > > > well.
> > > > > >
> > > > > > I am trying with *setVersionPolicy* method on
> > > > > > *HttpAsyncClients*
> > > > > > API
> > > > > > and if
> > > > > > use *NEGOTIATE* version policy then it is working fine. If I
> > > > > > use
> > > > > > any
> > > > > > of
> > > > > > *FORCE_HTTP_** version policy then I am getting *400 bad
> > > > > > request*.
> > > > > >
> > > > > > If I keep it as *NEGOTIATE* and then try to force HTTP2
> > > > > > request
> > > > > > using
> > > > > > *AsyncRequestBuilder* APIs setVersion method bu using
> > > > > > *HttpVersion.HTTP_2*
> > > > > > or  *HttpVersion.HTTP_2_0* argument request is failing with
> > > > > > *Unsupported
> > > > > > version* error.
> > > > > >
> > > > > > My usecase is I have a small web app which will be used by
> > > > > > users
> > > > > > to
> > > > > > get
> > > > > > data from different servers. I am using httpclient here to
> > > > > > get
> > > > > > data
> > > > > > from
> > > > > > pre-configured servers which I even don't know before hand.
> > > > > > Basically
> > > > > > kind
> > > > > > of reverse proxy. So if users request the data using HTTP 1.x
> > > > > > I
> > > > > > have
> > > > > > to get
> > > > > > data from backend server using HTTP 1.x only and vice-versa
> > > > > > as
> > > > > > well.
> > > > > >
> > > > > > Thank you once again for the help you are providing.
> > > > > >
> > > > >
> > > > > I am not sure I understand what your are trying to do here. If
> > > > > want
> > > > > HttpClient to negotiate the protocol you 

Re: Regarding HTTP2 support for classic 5.x httpclient

2022-11-19 Thread Oleg Kalnichevski
On Sat, 2022-11-19 at 23:22 +0530, sreenivas somavarapu wrote:
> Hi Oleg,
> 
> Yes if actual server doesn't support the request should fail. As
> conveyed
> earlier I am trying simple reverse proxy application for which
> requirement
> is end to end flow should use same protocol. My application gets
> request
> from users and my application should make sure that same protocol
> should be
> used as in request when getting the response from different servers
> using
> httpclient. So I was checking the feasibility in httpclient classic /
> async
> implementations to see if I could achieve that using same httpclient
> method.
> 
> Regards,
> Sreenivas
> 

I am still confused. If you do not want protocol negotiation, just do
not use it. If can force the desired protocol version.

Oleg


> On Sat, Nov 19, 2022, 11:13 PM Oleg Kalnichevski 
> wrote:
> 
> > On Sat, 2022-11-19 at 23:10 +0530, sreenivas somavarapu wrote:
> > > Hi Oleg,
> > > 
> > > Thank you for your reply.
> > > 
> > > My simple use case is I want to control on which channel /
> > > protocol
> > > (HTTP 1.x or HTTP 2) the requests should use using async
> > > httpclient
> > > api implementation irrespective of backend server enablement of
> > > that
> > > respective protocol.
> > 
> > This makes no sense. If the opposite endpoint does not support H2
> > HttpClient will not be able to execute request with that protocol.
> > 
> > Oleg
> > 
> > 
> > 
> > 
> > > Regards,
> > > Sreenivas
> > > 
> > > On Sat, Nov 19, 2022, 3:47 PM Oleg Kalnichevski
> > > 
> > > wrote:
> > > > On Fri, 2022-11-18 at 13:45 +0530, sreenivas somavarapu wrote:
> > > > > Hi Oleg,
> > > > > 
> > > > > Thank you for your reply and conformation.
> > > > > 
> > > > > I was looking at async APIs on how to achieve both HTTP 1.x
> > > > > and
> > > > > HTTP
> > > > > 2
> > > > > support using same HttpAsyncClients builder but initial
> > > > > glance at
> > > > > APIs
> > > > > looks like it is not possible. Is my understanding correct?
> > > > 
> > > > 
> > > > No, it is not.
> > > > 
> > > > 
> > > > >   Below are
> > > > > different types of configurations I have used. Please let me
> > > > > know
> > > > > if
> > > > > you
> > > > > need my complete sample code? For these tests I was using IIS
> > > > > server
> > > > > with
> > > > > HTTP2 enabled and as well as https://hc.apache.org website as
> > > > > well.
> > > > > 
> > > > > I am trying with *setVersionPolicy* method on
> > > > > *HttpAsyncClients*
> > > > > API
> > > > > and if
> > > > > use *NEGOTIATE* version policy then it is working fine. If I
> > > > > use
> > > > > any
> > > > > of
> > > > > *FORCE_HTTP_** version policy then I am getting *400 bad
> > > > > request*.
> > > > > 
> > > > > If I keep it as *NEGOTIATE* and then try to force HTTP2
> > > > > request
> > > > > using
> > > > > *AsyncRequestBuilder* APIs setVersion method bu using
> > > > > *HttpVersion.HTTP_2*
> > > > > or  *HttpVersion.HTTP_2_0* argument request is failing with
> > > > > *Unsupported
> > > > > version* error.
> > > > > 
> > > > > My usecase is I have a small web app which will be used by
> > > > > users
> > > > > to
> > > > > get
> > > > > data from different servers. I am using httpclient here to
> > > > > get
> > > > > data
> > > > > from
> > > > > pre-configured servers which I even don't know before hand.
> > > > > Basically
> > > > > kind
> > > > > of reverse proxy. So if users request the data using HTTP 1.x
> > > > > I
> > > > > have
> > > > > to get
> > > > > data from backend server using HTTP 1.x only and vice-versa
> > > > > as
> > > > > well.
> > > > > 
> > > > > Thank you once again for the help you are providing.
> > > > > 
> > > > 
> > > > I am not sure I understand what your are trying to do here. If
> > > > want
> > > > HttpClient to negotiate the protocol you need to use the
> > > > NEGOTIATE
> > > > protocol policy with HTTPS. One only needs to use FORCE_HTTP_2
> > > > when
> > > > connecting to an HTTP/2 endpoint over HTTP (so called h2c).
> > > > 
> > > > Oleg
> > > > 
> > > > 
> > > > ---
> > > > 
> > > > --
> > > > To unsubscribe, e-mail:
> > > > httpclient-users-unsubscr...@hc.apache.org
> > > > For additional commands, e-mail:
> > > > httpclient-users-h...@hc.apache.org
> > > > 
> > 
> > 


-
To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org
For additional commands, e-mail: httpclient-users-h...@hc.apache.org



Re: Regarding HTTP2 support for classic 5.x httpclient

2022-11-19 Thread sreenivas somavarapu
Hi Oleg,

Yes if actual server doesn't support the request should fail. As conveyed
earlier I am trying simple reverse proxy application for which requirement
is end to end flow should use same protocol. My application gets request
from users and my application should make sure that same protocol should be
used as in request when getting the response from different servers using
httpclient. So I was checking the feasibility in httpclient classic / async
implementations to see if I could achieve that using same httpclient method.

Regards,
Sreenivas

On Sat, Nov 19, 2022, 11:13 PM Oleg Kalnichevski  wrote:

> On Sat, 2022-11-19 at 23:10 +0530, sreenivas somavarapu wrote:
> > Hi Oleg,
> >
> > Thank you for your reply.
> >
> > My simple use case is I want to control on which channel / protocol
> > (HTTP 1.x or HTTP 2) the requests should use using async httpclient
> > api implementation irrespective of backend server enablement of that
> > respective protocol.
>
> This makes no sense. If the opposite endpoint does not support H2
> HttpClient will not be able to execute request with that protocol.
>
> Oleg
>
>
>
>
> > Regards,
> > Sreenivas
> >
> > On Sat, Nov 19, 2022, 3:47 PM Oleg Kalnichevski 
> > wrote:
> > > On Fri, 2022-11-18 at 13:45 +0530, sreenivas somavarapu wrote:
> > > > Hi Oleg,
> > > >
> > > > Thank you for your reply and conformation.
> > > >
> > > > I was looking at async APIs on how to achieve both HTTP 1.x and
> > > > HTTP
> > > > 2
> > > > support using same HttpAsyncClients builder but initial glance at
> > > > APIs
> > > > looks like it is not possible. Is my understanding correct?
> > >
> > >
> > > No, it is not.
> > >
> > >
> > > >   Below are
> > > > different types of configurations I have used. Please let me know
> > > > if
> > > > you
> > > > need my complete sample code? For these tests I was using IIS
> > > > server
> > > > with
> > > > HTTP2 enabled and as well as https://hc.apache.org website as
> > > > well.
> > > >
> > > > I am trying with *setVersionPolicy* method on *HttpAsyncClients*
> > > > API
> > > > and if
> > > > use *NEGOTIATE* version policy then it is working fine. If I use
> > > > any
> > > > of
> > > > *FORCE_HTTP_** version policy then I am getting *400 bad
> > > > request*.
> > > >
> > > > If I keep it as *NEGOTIATE* and then try to force HTTP2 request
> > > > using
> > > > *AsyncRequestBuilder* APIs setVersion method bu using
> > > > *HttpVersion.HTTP_2*
> > > > or  *HttpVersion.HTTP_2_0* argument request is failing with
> > > > *Unsupported
> > > > version* error.
> > > >
> > > > My usecase is I have a small web app which will be used by users
> > > > to
> > > > get
> > > > data from different servers. I am using httpclient here to get
> > > > data
> > > > from
> > > > pre-configured servers which I even don't know before hand.
> > > > Basically
> > > > kind
> > > > of reverse proxy. So if users request the data using HTTP 1.x I
> > > > have
> > > > to get
> > > > data from backend server using HTTP 1.x only and vice-versa as
> > > > well.
> > > >
> > > > Thank you once again for the help you are providing.
> > > >
> > >
> > > I am not sure I understand what your are trying to do here. If want
> > > HttpClient to negotiate the protocol you need to use the NEGOTIATE
> > > protocol policy with HTTPS. One only needs to use FORCE_HTTP_2 when
> > > connecting to an HTTP/2 endpoint over HTTP (so called h2c).
> > >
> > > Oleg
> > >
> > >
> > > ---
> > > --
> > > To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org
> > > For additional commands, e-mail:
> > > httpclient-users-h...@hc.apache.org
> > >
>
>


Re: Regarding HTTP2 support for classic 5.x httpclient

2022-11-19 Thread Oleg Kalnichevski
On Sat, 2022-11-19 at 23:10 +0530, sreenivas somavarapu wrote:
> Hi Oleg,
> 
> Thank you for your reply. 
> 
> My simple use case is I want to control on which channel / protocol
> (HTTP 1.x or HTTP 2) the requests should use using async httpclient
> api implementation irrespective of backend server enablement of that
> respective protocol.

This makes no sense. If the opposite endpoint does not support H2
HttpClient will not be able to execute request with that protocol.

Oleg




> Regards,
> Sreenivas
> 
> On Sat, Nov 19, 2022, 3:47 PM Oleg Kalnichevski 
> wrote:
> > On Fri, 2022-11-18 at 13:45 +0530, sreenivas somavarapu wrote:
> > > Hi Oleg,
> > > 
> > > Thank you for your reply and conformation.
> > > 
> > > I was looking at async APIs on how to achieve both HTTP 1.x and
> > > HTTP
> > > 2
> > > support using same HttpAsyncClients builder but initial glance at
> > > APIs
> > > looks like it is not possible. Is my understanding correct?
> > 
> > 
> > No, it is not.
> > 
> > 
> > >   Below are
> > > different types of configurations I have used. Please let me know
> > > if
> > > you
> > > need my complete sample code? For these tests I was using IIS
> > > server
> > > with
> > > HTTP2 enabled and as well as https://hc.apache.org website as
> > > well.
> > > 
> > > I am trying with *setVersionPolicy* method on *HttpAsyncClients*
> > > API
> > > and if
> > > use *NEGOTIATE* version policy then it is working fine. If I use
> > > any
> > > of
> > > *FORCE_HTTP_** version policy then I am getting *400 bad
> > > request*.
> > > 
> > > If I keep it as *NEGOTIATE* and then try to force HTTP2 request
> > > using
> > > *AsyncRequestBuilder* APIs setVersion method bu using
> > > *HttpVersion.HTTP_2*
> > > or  *HttpVersion.HTTP_2_0* argument request is failing with
> > > *Unsupported
> > > version* error.
> > > 
> > > My usecase is I have a small web app which will be used by users
> > > to
> > > get
> > > data from different servers. I am using httpclient here to get
> > > data
> > > from
> > > pre-configured servers which I even don't know before hand.
> > > Basically
> > > kind
> > > of reverse proxy. So if users request the data using HTTP 1.x I
> > > have
> > > to get
> > > data from backend server using HTTP 1.x only and vice-versa as
> > > well.
> > > 
> > > Thank you once again for the help you are providing.
> > > 
> > 
> > I am not sure I understand what your are trying to do here. If want
> > HttpClient to negotiate the protocol you need to use the NEGOTIATE
> > protocol policy with HTTPS. One only needs to use FORCE_HTTP_2 when
> > connecting to an HTTP/2 endpoint over HTTP (so called h2c).
> > 
> > Oleg
> > 
> > 
> > ---
> > --
> > To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org
> > For additional commands, e-mail:
> > httpclient-users-h...@hc.apache.org
> > 


-
To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org
For additional commands, e-mail: httpclient-users-h...@hc.apache.org



Re: Regarding HTTP2 support for classic 5.x httpclient

2022-11-19 Thread sreenivas somavarapu
Hi Oleg,

Thank you for your reply.

My simple use case is I want to control on which channel / protocol (HTTP
1.x or HTTP 2) the requests should use using async httpclient api
implementation irrespective of backend server enablement of that respective
protocol. Is there a way to achieve this usecase using same connection pool
manager / single httpclient object?

Regards,
Sreenivas

On Sat, Nov 19, 2022, 3:47 PM Oleg Kalnichevski  wrote:

> On Fri, 2022-11-18 at 13:45 +0530, sreenivas somavarapu wrote:
> > Hi Oleg,
> >
> > Thank you for your reply and conformation.
> >
> > I was looking at async APIs on how to achieve both HTTP 1.x and HTTP
> > 2
> > support using same HttpAsyncClients builder but initial glance at
> > APIs
> > looks like it is not possible. Is my understanding correct?
>
>
> No, it is not.
>
>
> >  Below are
> > different types of configurations I have used. Please let me know if
> > you
> > need my complete sample code? For these tests I was using IIS server
> > with
> > HTTP2 enabled and as well as https://hc.apache.org website as well.
> >
> > I am trying with *setVersionPolicy* method on *HttpAsyncClients* API
> > and if
> > use *NEGOTIATE* version policy then it is working fine. If I use any
> > of
> > *FORCE_HTTP_** version policy then I am getting *400 bad request*.
> >
> > If I keep it as *NEGOTIATE* and then try to force HTTP2 request using
> > *AsyncRequestBuilder* APIs setVersion method bu using
> > *HttpVersion.HTTP_2*
> > or  *HttpVersion.HTTP_2_0* argument request is failing with
> > *Unsupported
> > version* error.
> >
> > My usecase is I have a small web app which will be used by users to
> > get
> > data from different servers. I am using httpclient here to get data
> > from
> > pre-configured servers which I even don't know before hand. Basically
> > kind
> > of reverse proxy. So if users request the data using HTTP 1.x I have
> > to get
> > data from backend server using HTTP 1.x only and vice-versa as well.
> >
> > Thank you once again for the help you are providing.
> >
>
> I am not sure I understand what your are trying to do here. If want
> HttpClient to negotiate the protocol you need to use the NEGOTIATE
> protocol policy with HTTPS. One only needs to use FORCE_HTTP_2 when
> connecting to an HTTP/2 endpoint over HTTP (so called h2c).
>
> Oleg
>
>
> -
> To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org
> For additional commands, e-mail: httpclient-users-h...@hc.apache.org
>
>


Re: Regarding HTTP2 support for classic 5.x httpclient

2022-11-19 Thread Oleg Kalnichevski
On Fri, 2022-11-18 at 13:45 +0530, sreenivas somavarapu wrote:
> Hi Oleg,
> 
> Thank you for your reply and conformation.
> 
> I was looking at async APIs on how to achieve both HTTP 1.x and HTTP
> 2
> support using same HttpAsyncClients builder but initial glance at
> APIs
> looks like it is not possible. Is my understanding correct?


No, it is not.


>  Below are
> different types of configurations I have used. Please let me know if
> you
> need my complete sample code? For these tests I was using IIS server
> with
> HTTP2 enabled and as well as https://hc.apache.org website as well.
> 
> I am trying with *setVersionPolicy* method on *HttpAsyncClients* API
> and if
> use *NEGOTIATE* version policy then it is working fine. If I use any
> of
> *FORCE_HTTP_** version policy then I am getting *400 bad request*.
> 
> If I keep it as *NEGOTIATE* and then try to force HTTP2 request using
> *AsyncRequestBuilder* APIs setVersion method bu using
> *HttpVersion.HTTP_2*
> or  *HttpVersion.HTTP_2_0* argument request is failing with
> *Unsupported
> version* error.
> 
> My usecase is I have a small web app which will be used by users to
> get
> data from different servers. I am using httpclient here to get data
> from
> pre-configured servers which I even don't know before hand. Basically
> kind
> of reverse proxy. So if users request the data using HTTP 1.x I have
> to get
> data from backend server using HTTP 1.x only and vice-versa as well.
> 
> Thank you once again for the help you are providing.
> 

I am not sure I understand what your are trying to do here. If want
HttpClient to negotiate the protocol you need to use the NEGOTIATE
protocol policy with HTTPS. One only needs to use FORCE_HTTP_2 when
connecting to an HTTP/2 endpoint over HTTP (so called h2c).

Oleg


-
To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org
For additional commands, e-mail: httpclient-users-h...@hc.apache.org



Re: Regarding HTTP2 support for classic 5.x httpclient

2022-11-18 Thread sreenivas somavarapu
Hi Oleg,

Thank you for your reply and conformation.

I was looking at async APIs on how to achieve both HTTP 1.x and HTTP 2
support using same HttpAsyncClients builder but initial glance at APIs
looks like it is not possible. Is my understanding correct? Below are
different types of configurations I have used. Please let me know if you
need my complete sample code? For these tests I was using IIS server with
HTTP2 enabled and as well as https://hc.apache.org website as well.

I am trying with *setVersionPolicy* method on *HttpAsyncClients* API and if
use *NEGOTIATE* version policy then it is working fine. If I use any of
*FORCE_HTTP_** version policy then I am getting *400 bad request*.

If I keep it as *NEGOTIATE* and then try to force HTTP2 request using
*AsyncRequestBuilder* APIs setVersion method bu using *HttpVersion.HTTP_2*
or  *HttpVersion.HTTP_2_0* argument request is failing with *Unsupported
version* error.

My usecase is I have a small web app which will be used by users to get
data from different servers. I am using httpclient here to get data from
pre-configured servers which I even don't know before hand. Basically kind
of reverse proxy. So if users request the data using HTTP 1.x I have to get
data from backend server using HTTP 1.x only and vice-versa as well.

Thank you once again for the help you are providing.

Regards,
Sreenivas

On Fri, Nov 4, 2022, 5:30 PM Oleg Kalnichevski  wrote:

> On Fri, 2022-11-04 at 04:16 +0530, sreenivas somavarapu wrote:
> > Hi Team,
> >
> > Might be the query had been answered before but I tried to search and
> > was
> > unscuccessful to find any reference stating whether Apache HTTPClient
> > 5.x
> > classic api implementation is supporting HTTP 2 requests or not.
> >
> > I am trying to set request as HTTP 2 using below code but server is
> > throwing 400 and if use my own IIS server it is throwing 500
> > "*Version Not
> > Supported*” as I could see in java ssl debug in both cases it is
> > being sent
> > as “GET / HTTP/2.0”. If I define my own *ProtocolVersion* class and
> > override *format* method in that class to send request “GET / HTTP/2”
> > (Similar to how browsers send) I am getting even 400 error from IIS.
> >
> >
> > *final HttpGet httpget = new HttpGet("https://hc.apache.org/
> > ”);*
> > *httpget.setVersion(HttpVersion.HTTP_2);*
> >
> > Thanks & Regards,
> > Sreenivas
> >
> > >
>
> Sreenivas,
>
> The classic I/O (InputStream / OutputStream API based) is perfectly
> adequate and works quite well for request / response oriented protocols
> such as HTTP/1.1.
>
> The HTTP/2 protocol is completely different. It is frame based and can
> multiplex multiple message exchange streams over the same physical
> connection. The message stream multiplexing just does not work well
> with the classic I/O. Classic HttpClient 5.x implementation presently
> does not support HTTP/2 and most likely never will. If one needs HTTP/2
> one has to switch to Async HttpClient 5.x.
>
> Oleg
>
>
> -
> To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org
> For additional commands, e-mail: httpclient-users-h...@hc.apache.org
>
>


Re: Regarding HTTP2 support for classic 5.x httpclient

2022-11-06 Thread Gary Gregory
FWIW, for Kerberos (at work), we use Apache Kerby.

Gary

On Sun, Nov 6, 2022, 04:02 Michael Osipov  wrote:

> Am 2022-11-05 um 11:51 schrieb Oleg Kalnichevski:
> > On Sat, 2022-11-05 at 09:47 +0100, Michael Osipov wrote:
> >> Am 2022-11-04 um 12:59 schrieb Oleg Kalnichevski:
> >>> On Fri, 2022-11-04 at 04:16 +0530, sreenivas somavarapu wrote:
> >
> >
> > ...
> >
> >
> >>>
> >>> Sreenivas,
> >>>
> >>> The classic I/O (InputStream / OutputStream API based) is perfectly
> >>> adequate and works quite well for request / response oriented
> >>> protocols
> >>> such as HTTP/1.1.
> >>>
> >>> The HTTP/2 protocol is completely different. It is frame based and
> >>> can
> >>> multiplex multiple message exchange streams over the same physical
> >>> connection. The message stream multiplexing just does not work well
> >>> with the classic I/O. Classic HttpClient 5.x implementation
> >>> presently
> >>> does not support HTTP/2 and most likely never will. If one needs
> >>> HTTP/2
> >>> one has to switch to Async HttpClient 5.x.
> >>
> >> This also means that https://issues.apache.org/jira/browse/WAGON-606
> >> would never happen unless to be rewritten to the async client.
> >>
> >
> > Yes, it does. I seriously doubt HTTP/2 support would bring any
> > advantage to Maven Wagon. Two concurrent HTTP/1.1 connections will very
> > likely do better as a transport for artifact upload / download than two
> > concurrent HTTP/2 connections or two concurrent streams over a single
> > HTTP/2 connection.
>
> I share your opion putting weeks into unpaid effort for a marginal
> benefit isn't acceptable for me.
>
> > Having said all that, how about this? I promise to build a HTTP/2
> > implementation of Maven Wagon and contribute it to the Maven project,
> > if you can find some time to assess the state of our Kerberos code and
> > help us decide if there is any hope of fixing it or we should just go
> > ahead and deprecate it along with NTLM.
>
> Having that said, I don't it is worth the effort to put your time into.
> Even if you do, my async knowledge which means that we don't have
> anymore on the Maven team which could pick up your work reasonably.
> As for pure Kerberos and NTLM: Pure Kerberos over HTTP has never
> existed, only through SPNEGO. NTLM is basically dead. Even Cyrus SASL
> has disabled/removed their implementation. [1]
>
> I will consider your offer, but I think it is a bad bargain.
>
> M
>
> [1] https://github.com/cyrusimap/cyrus-sasl/pull/736
>
>
> -
> To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org
> For additional commands, e-mail: httpclient-users-h...@hc.apache.org
>
>


Re: Regarding HTTP2 support for classic 5.x httpclient

2022-11-06 Thread Michael Osipov

Am 2022-11-05 um 11:51 schrieb Oleg Kalnichevski:

On Sat, 2022-11-05 at 09:47 +0100, Michael Osipov wrote:

Am 2022-11-04 um 12:59 schrieb Oleg Kalnichevski:

On Fri, 2022-11-04 at 04:16 +0530, sreenivas somavarapu wrote:




...




Sreenivas,

The classic I/O (InputStream / OutputStream API based) is perfectly
adequate and works quite well for request / response oriented
protocols
such as HTTP/1.1.

The HTTP/2 protocol is completely different. It is frame based and
can
multiplex multiple message exchange streams over the same physical
connection. The message stream multiplexing just does not work well
with the classic I/O. Classic HttpClient 5.x implementation
presently
does not support HTTP/2 and most likely never will. If one needs
HTTP/2
one has to switch to Async HttpClient 5.x.


This also means that https://issues.apache.org/jira/browse/WAGON-606
would never happen unless to be rewritten to the async client.



Yes, it does. I seriously doubt HTTP/2 support would bring any
advantage to Maven Wagon. Two concurrent HTTP/1.1 connections will very
likely do better as a transport for artifact upload / download than two
concurrent HTTP/2 connections or two concurrent streams over a single
HTTP/2 connection.


I share your opion putting weeks into unpaid effort for a marginal 
benefit isn't acceptable for me.



Having said all that, how about this? I promise to build a HTTP/2
implementation of Maven Wagon and contribute it to the Maven project,
if you can find some time to assess the state of our Kerberos code and
help us decide if there is any hope of fixing it or we should just go
ahead and deprecate it along with NTLM.


Having that said, I don't it is worth the effort to put your time into. 
Even if you do, my async knowledge which means that we don't have 
anymore on the Maven team which could pick up your work reasonably.
As for pure Kerberos and NTLM: Pure Kerberos over HTTP has never 
existed, only through SPNEGO. NTLM is basically dead. Even Cyrus SASL 
has disabled/removed their implementation. [1]


I will consider your offer, but I think it is a bad bargain.

M

[1] https://github.com/cyrusimap/cyrus-sasl/pull/736


-
To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org
For additional commands, e-mail: httpclient-users-h...@hc.apache.org



Re: Regarding HTTP2 support for classic 5.x httpclient

2022-11-05 Thread Tamás Cservenák
Please, forget Wagon (is Maven2 relic). Better do resolver-transport with
http5 async instead :)

T

On Sat, Nov 5, 2022, 11:51 Oleg Kalnichevski  wrote:

>
> Having said all that, how about this? I promise to build a HTTP/2
> implementation of Maven Wagon and contribute it to the Maven project


>
>


Re: Regarding HTTP2 support for classic 5.x httpclient

2022-11-05 Thread Oleg Kalnichevski
On Sat, 2022-11-05 at 09:47 +0100, Michael Osipov wrote:
> Am 2022-11-04 um 12:59 schrieb Oleg Kalnichevski:
> > On Fri, 2022-11-04 at 04:16 +0530, sreenivas somavarapu wrote:
> > > > 

...


> > 
> > Sreenivas,
> > 
> > The classic I/O (InputStream / OutputStream API based) is perfectly
> > adequate and works quite well for request / response oriented
> > protocols
> > such as HTTP/1.1.
> > 
> > The HTTP/2 protocol is completely different. It is frame based and
> > can
> > multiplex multiple message exchange streams over the same physical
> > connection. The message stream multiplexing just does not work well
> > with the classic I/O. Classic HttpClient 5.x implementation
> > presently
> > does not support HTTP/2 and most likely never will. If one needs
> > HTTP/2
> > one has to switch to Async HttpClient 5.x.
> 
> This also means that https://issues.apache.org/jira/browse/WAGON-606 
> would never happen unless to be rewritten to the async client.
> 

Yes, it does. I seriously doubt HTTP/2 support would bring any
advantage to Maven Wagon. Two concurrent HTTP/1.1 connections will very
likely do better as a transport for artifact upload / download than two
concurrent HTTP/2 connections or two concurrent streams over a single
HTTP/2 connection.

Having said all that, how about this? I promise to build a HTTP/2
implementation of Maven Wagon and contribute it to the Maven project,
if you can find some time to assess the state of our Kerberos code and
help us decide if there is any hope of fixing it or we should just go
ahead and deprecate it along with NTLM.

Oleg


-
To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org
For additional commands, e-mail: httpclient-users-h...@hc.apache.org



Re: Regarding HTTP2 support for classic 5.x httpclient

2022-11-05 Thread Michael Osipov

Am 2022-11-04 um 12:59 schrieb Oleg Kalnichevski:

On Fri, 2022-11-04 at 04:16 +0530, sreenivas somavarapu wrote:

Hi Team,

Might be the query had been answered before but I tried to search and
was
unscuccessful to find any reference stating whether Apache HTTPClient
5.x
classic api implementation is supporting HTTP 2 requests or not.

I am trying to set request as HTTP 2 using below code but server is
throwing 400 and if use my own IIS server it is throwing 500
"*Version Not
Supported*” as I could see in java ssl debug in both cases it is
being sent
as “GET / HTTP/2.0”. If I define my own *ProtocolVersion* class and
override *format* method in that class to send request “GET / HTTP/2”
(Similar to how browsers send) I am getting even 400 error from IIS.


*final HttpGet httpget = new HttpGet("https://hc.apache.org/
”);*
*httpget.setVersion(HttpVersion.HTTP_2);*

Thanks & Regards,
Sreenivas





Sreenivas,

The classic I/O (InputStream / OutputStream API based) is perfectly
adequate and works quite well for request / response oriented protocols
such as HTTP/1.1.

The HTTP/2 protocol is completely different. It is frame based and can
multiplex multiple message exchange streams over the same physical
connection. The message stream multiplexing just does not work well
with the classic I/O. Classic HttpClient 5.x implementation presently
does not support HTTP/2 and most likely never will. If one needs HTTP/2
one has to switch to Async HttpClient 5.x.


This also means that https://issues.apache.org/jira/browse/WAGON-606 
would never happen unless to be rewritten to the async client.


M


-
To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org
For additional commands, e-mail: httpclient-users-h...@hc.apache.org



Re: Regarding HTTP2 support for classic 5.x httpclient

2022-11-04 Thread Oleg Kalnichevski
On Fri, 2022-11-04 at 04:16 +0530, sreenivas somavarapu wrote:
> Hi Team,
> 
> Might be the query had been answered before but I tried to search and
> was
> unscuccessful to find any reference stating whether Apache HTTPClient
> 5.x
> classic api implementation is supporting HTTP 2 requests or not.
> 
> I am trying to set request as HTTP 2 using below code but server is
> throwing 400 and if use my own IIS server it is throwing 500
> "*Version Not
> Supported*” as I could see in java ssl debug in both cases it is
> being sent
> as “GET / HTTP/2.0”. If I define my own *ProtocolVersion* class and
> override *format* method in that class to send request “GET / HTTP/2”
> (Similar to how browsers send) I am getting even 400 error from IIS.
> 
> 
> *final HttpGet httpget = new HttpGet("https://hc.apache.org/
> ”);*
> *httpget.setVersion(HttpVersion.HTTP_2);*
> 
> Thanks & Regards,
> Sreenivas
> 
> > 

Sreenivas,

The classic I/O (InputStream / OutputStream API based) is perfectly
adequate and works quite well for request / response oriented protocols
such as HTTP/1.1. 

The HTTP/2 protocol is completely different. It is frame based and can
multiplex multiple message exchange streams over the same physical
connection. The message stream multiplexing just does not work well
with the classic I/O. Classic HttpClient 5.x implementation presently
does not support HTTP/2 and most likely never will. If one needs HTTP/2
one has to switch to Async HttpClient 5.x.

Oleg


-
To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org
For additional commands, e-mail: httpclient-users-h...@hc.apache.org