Re: [HttpClient 4.5.5 ]Proxy-Authorization header missing while requesting HTTPS url

2019-07-15 Thread Bernd Eckenfels
The scenario is different, with http you have the proxy and taget request being 
the same, with connect proxies they are separate requests.

In both cases however you would not set the header yourself but use the 
appropriate authentication method on the proxy scope of the  credential 
provider (however I am not sure if this works preemptive).

--
https://Bernd.eckenfels.net


Von: Kaushal Kothari 
Gesendet: Montag, Juli 15, 2019 1:40 PM
An: httpclient-users@hc.apache.org
Betreff: Re: [HttpClient 4.5.5 ]Proxy-Authorization header missing while 
requesting HTTPS url

Does HttpClient not send the "Proxy-Authorization" header along with CONNECT 
request when we access the HTTPS url?

As I mentioned earlier,I tried same scenario to access the HTTP request 
everything works fine.

http://hc.apache.org/httpcomponents-client-4.5.x/examples.html

Thanks,
Kaushal.

On Mon, Jul 15, 2019 at 3:02 PM Kaushal Kothari 
mailto:kaushalkothari2...@gmail.com>> wrote:
Just for clarification,I want to access the HTTPS url via proxy server and 
proxy server has the basic authentication set.

In order to authenticate,"Proxy-Authorization Basic " header 
should be sent along with CONNECT request but which is missing.

you might have seen in last mail attached screenshot.If you are unable to see 
then let me know how can I send it to you again?

So I created the POST request using the HttpPost class which is from the 
HttpClient API. HttpClient doesn't generate the "Proxy-Authorization Basic 
" header so added the same and pass it to HttpClient to extract it 
from the POST request.

 request = new HttpPost();   //please refer screenshot in last mail for details 
in request object
 request.addHeader("Proxy-Authorization","Basic "+encodedAuth);
 httpResponse = httpClientBuilder.execute(request);



On Fri, Jul 12, 2019 at 5:55 PM Kaushal Kothari 
mailto:kaushalkothari2...@gmail.com>> wrote:
Hi Team,

I am trying to do POC using the HttpClient 4.5.5 library and want to access 
HTTPS url masked through a http proxy server with basic authentication
and its failing.

The authentication proxy header should be sent as part of the connect but it is 
not happening.

I have also added the header "Proxy-Authorization Basic " to POST 
request as it requires and passing request object to httpclient through 
execute() method.

Apart from that preemptive authentication is also set.


[image.png]

But over the network, "Proxy-Authorization Basic  " header is 
missing.

I tried same scenario to access the HTTP request everything works fine.

On the fly [No "Proxy-Authorization" header]:

[image.png]
REQUEST:

CONNECT localhost:4080 HTTP/1.1
Host: 127.0.0.1:9090
User-Agent: Apache-HttpClient/4.5.5 (Java/1.8.0_191)

RESPONSE:

"HTTP/1.1 407 Proxy Authentication Required
Server: Proxy
Proxy-Authenticate: Basic realm=" Authorization"
Cache-control: no-cache
Connection: Close
Proxy-Connection: Close
Content-Length: 0"

Could you please help me on this issue? and let me know if you require any 
further information.

--
Thanks,
Kaushal.


Re: [HttpClient 4.5.5 ]Proxy-Authorization header missing while requesting HTTPS url

2019-07-15 Thread Kaushal Kothari
Does HttpClient not send the "Proxy-Authorization" header along with
CONNECT request when we access the *HTTPS *url?

As I mentioned earlier,I tried *same *scenario to access the *HTTP *request
everything works fine.

http://hc.apache.org/httpcomponents-client-4.5.x/examples.html


Thanks,
Kaushal.

On Mon, Jul 15, 2019 at 3:02 PM Kaushal Kothari <
kaushalkothari2...@gmail.com> wrote:

> Just for clarification,I want to access the HTTPS url via proxy server and
> proxy server has the basic authentication set.
>
> In order to authenticate,"Proxy-Authorization Basic " header
> should be sent along with CONNECT request but which is missing.
>
> you might have seen in last mail attached screenshot.If you are unable to
> see then let me know how can I send it to you again?
>
> So I created the POST request using the HttpPost class which is from the
> HttpClient API. HttpClient doesn't generate the "Proxy-Authorization Basic
> " header so added the same and pass it to HttpClient to
> extract it from the POST request.
>
>  request = new HttpPost();   //please refer screenshot in last mail for
> details in request object
>  request.addHeader("Proxy-Authorization","Basic "+encodedAuth);
>  httpResponse = httpClientBuilder.execute(request);
>
>
>
> On Fri, Jul 12, 2019 at 5:55 PM Kaushal Kothari <
> kaushalkothari2...@gmail.com> wrote:
>
>> Hi Team,
>>
>> I am trying to do POC using the *HttpClient 4.5.5* library and want to
>> access *HTTPS url* masked through a http *proxy server* with *basic
>> authentication*
>> and its failing.
>>
>> The authentication proxy header should be sent as part of the connect but
>> it is not happening.
>>
>> I have also added the header "*Proxy-Authorization Basic *"
>> to *POST request *as it requires and passing request object to
>> httpclient through execute() method.
>>
>> Apart from that preemptive authentication is also set.
>>
>>
>> [image: image.png]
>>
>> But *over the network,* "*Proxy-Authorization Basic  *"
>> header is *missing*.
>>
>> I tried *same *scenario to access the HTTP request everything works fine.
>>
>> *On the fly* [No "Proxy-Authorization" header]:
>>
>> [image: image.png]
>> REQUEST:
>>
>> CONNECT localhost:4080 HTTP/1.1
>> Host: 127.0.0.1:9090
>> User-Agent: Apache-HttpClient/4.5.5 (Java/1.8.0_191)
>>
>> RESPONSE:
>>
>> "HTTP/1.1 407 Proxy Authentication Required
>> Server: Proxy
>> Proxy-Authenticate: Basic realm=" Authorization"
>> Cache-control: no-cache
>> Connection: Close
>> Proxy-Connection: Close
>> Content-Length: 0"
>>
>> Could you please help me on this issue? and let me know if you require
>> any further information.
>>
>> --
>> Thanks,
>> Kaushal.
>>
>


Re: [HttpClient 4.5.5 ]Proxy-Authorization header missing while requesting HTTPS url

2019-07-15 Thread Oleg Kalnichevski
On Mon, 2019-07-15 at 15:02 +0530, Kaushal Kothari wrote:
> Just for clarification,I want to access the HTTPS url via proxy
> server and proxy server has the basic authentication set.
> 
> In order to authenticate,"Proxy-Authorization Basic "
> header should be sent along with CONNECT request but which is
> missing.
> 

It is missing because HttpClient has not been correctly configured to
respond the the authentication challenge.

you might have seen in last mail attached screenshot.If you are
> unable to see then let me know how can I send it to you again? 
>  
> So I created the POST request using the HttpPost class which is from
> the HttpClient API. HttpClient doesn't generate the "Proxy-
> Authorization Basic " header so added the same and pass
> it to HttpClient to extract it from the POST request.
> 

Why are you adding `Proxy-Authorization` to the POST request? This
makes no sense.

Please see HttpClient documentation, in particular, `Proxy
authentication` code example:

http://hc.apache.org/httpcomponents-client-4.5.x/examples.html

Oleg


>  request = new HttpPost();   //please refer screenshot in last mail
> for details in request object
>  request.addHeader("Proxy-Authorization","Basic "+encodedAuth);
>  httpResponse = httpClientBuilder.execute(request);
> 
> 
> 
> On Fri, Jul 12, 2019 at 5:55 PM Kaushal Kothari <
> kaushalkothari2...@gmail.com> wrote:
> > Hi Team,
> > 
> > I am trying to do POC using the HttpClient 4.5.5 library and want
> > to access HTTPS url masked through a http proxy server with basic
> > authentication
> > and its failing.
> > 
> > The authentication proxy header should be sent as part of the
> > connect but it is not happening.
> > 
> > I have also added the header "Proxy-Authorization Basic
> > " to POST request as it requires and passing request
> > object to httpclient through execute() method.
> > 
> > Apart from that preemptive authentication is also set.
> > 
> > 
> > 
> > 
> > But over the network, "Proxy-Authorization Basic  "
> > header is missing.
> > 
> > I tried same scenario to access the HTTP request everything works
> > fine.
> > 
> > On the fly [No "Proxy-Authorization" header]:
> > 
> > 
> > REQUEST:
> > 
> > CONNECT localhost:4080 HTTP/1.1
> > Host: 127.0.0.1:9090
> > User-Agent: Apache-HttpClient/4.5.5 (Java/1.8.0_191)
> > 
> > RESPONSE:
> > 
> > "HTTP/1.1 407 Proxy Authentication Required
> > Server: Proxy
> > Proxy-Authenticate: Basic realm=" Authorization"
> > Cache-control: no-cache
> > Connection: Close
> > Proxy-Connection: Close
> > Content-Length: 0"
> > 
> > Could you please help me on this issue? and let me know if you
> > require any further information.
> > 
> > -- 
> > Thanks,
> > Kaushal.


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



Re: [HttpClient 4.5.5 ]Proxy-Authorization header missing while requesting HTTPS url

2019-07-15 Thread Kaushal Kothari
Just for clarification,I want to access the HTTPS url via proxy server and
proxy server has the basic authentication set.

In order to authenticate,"Proxy-Authorization Basic " header
should be sent along with CONNECT request but which is missing.

you might have seen in last mail attached screenshot.If you are unable to
see then let me know how can I send it to you again?

So I created the POST request using the HttpPost class which is from the
HttpClient API. HttpClient doesn't generate the "Proxy-Authorization Basic
" header so added the same and pass it to HttpClient to
extract it from the POST request.

 request = new HttpPost();   //please refer screenshot in last mail for
details in request object
 request.addHeader("Proxy-Authorization","Basic "+encodedAuth);
 httpResponse = httpClientBuilder.execute(request);



On Fri, Jul 12, 2019 at 5:55 PM Kaushal Kothari <
kaushalkothari2...@gmail.com> wrote:

> Hi Team,
>
> I am trying to do POC using the *HttpClient 4.5.5* library and want to
> access *HTTPS url* masked through a http *proxy server* with *basic
> authentication*
> and its failing.
>
> The authentication proxy header should be sent as part of the connect but
> it is not happening.
>
> I have also added the header "*Proxy-Authorization Basic *"
> to *POST request *as it requires and passing request object to httpclient
> through execute() method.
>
> Apart from that preemptive authentication is also set.
>
>
> [image: image.png]
>
> But *over the network,* "*Proxy-Authorization Basic  *"
> header is *missing*.
>
> I tried *same *scenario to access the HTTP request everything works fine.
>
> *On the fly* [No "Proxy-Authorization" header]:
>
> [image: image.png]
> REQUEST:
>
> CONNECT localhost:4080 HTTP/1.1
> Host: 127.0.0.1:9090
> User-Agent: Apache-HttpClient/4.5.5 (Java/1.8.0_191)
>
> RESPONSE:
>
> "HTTP/1.1 407 Proxy Authentication Required
> Server: Proxy
> Proxy-Authenticate: Basic realm=" Authorization"
> Cache-control: no-cache
> Connection: Close
> Proxy-Connection: Close
> Content-Length: 0"
>
> Could you please help me on this issue? and let me know if you require any
> further information.
>
> --
> Thanks,
> Kaushal.
>


[ANNOUNCEMENT] HttpComponents Core 5.0 beta8 (GA candidate) released

2019-07-15 Thread Oleg Kalnichevski
The Apache HttpComponents project is pleased to announce 5.0-beta8 (GA
candidate) release of HttpComponents Core. 

This BETA fixes a number of defects found since the last release and
adds several convenience factory and builder classes, mainly for TLS
configuration and HTTP message construction.

As of this version all server and requester implementations exclude
weak TLS protocol versions and ciphers.

IMPORTANT: This release is expected to be the last BETA version. If no
major design flaws are found the actual 5.0 API will be frozen and the
next version will be promoted to GA.


Notable changes and features included in the 5.0 series:

* Support for HTTP/2 protocol and conformance to requirements and
recommendations of the latest HTTP/2 protocol specification (RFC 7540,
RFC 7541)

  Supported features:

** HPACK header compression
** stream multiplexing (client and server)
** flow control
** response push (client and server)
** message trailers
** expect-continue handshake
** connection validation (ping)
** application-layer protocol negotiation (ALPN) on Java 9+
** TLS 1.2 security features

   Features out of scope for 5.0 release:

** padding of outgoing frames
** stream priority
** plain connection HTTP/1.1 upgrade
** CONNECT method

* Improved conformance to requirements and recommendations of the
latest HTTP/1.1 protocol specification (RFC 7230, RFC 7231)

* New asynchronous HTTP transport APIs consistent for both HTTP/1.1 and
HTTP/2 transport.

* Redesigned I/O reactor APIs and improved NIO based reactor
implementation for a greater performance and scalability.

* Support for server side request filters for classic and asynchronous
server implementations. Request filters could be used to implement
cross-cutting protocol aspects such as the 'expect-continue'
handshaking and user authentication / authorization.

* Redesigned connection pool implementation with strict connection
limit guarantees. The connection pool is expected to have a better
performance under higher concurrency due to reduced global pool lock
contention.

* New connection pool implementation with lax connection limit
guarantees and better performance under higher concurrency due to
absence of a global pool lock.

* Package name space changed to 'org.apache.hc.core5'

* Maven group id changed to 'org.apache.httpcomponents.core5'

HttpCore 5.0 releases can be co-located with earlier versions.

The 5.0 APIs are considered feature complete and are not expected to
undergo any major changes anymore. The focus of development is now
shifting to API polish, code stabilization and documentation
improvements.

Download - 
Release notes - 
HttpComponents site - 

About HttpComponents Core

HttpCore is a set of HTTP/1.1 and HTTP/2 transport components that can
be used to build custom client and server side HTTP services with a
minimal footprint



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