hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lucas Sapp <fiery1...@gmail.com>
Subject Re: Addresses that do not Resolve an IP will cause an Error.
Date Thu, 09 Apr 2015 19:27:47 GMT
The DNS resolver is part of the problem creating a custom DnsResolver does
not appear to resolve the issue.

If the address is https://facebookcorewwwi.onion/ the server tries to
resolve this and fails, no ip address exists. This results in an
UnknownHostException which is the correct behavior if i wasn't using a
proxy.  I am using a custom socket factory that creates TOR socks5 sockets.
This address is valid (for tor) and should allow it to create
a connection to the server using hostname. Tor will create
the connection to the server by hostname since tor addresses do not have an
ip address. This is blocked however by the below line which forces the
InetSocketAddress to have a null hostname, by constructor.

final InetSocketAddress remoteAddress = new InetSocketAddress(address,port);

Since there is no easy access to HttpClientConnectionManager it is
difficult to make update this for my specific use case. I was wondering if
there was a way to allow it to create the socket using the Host rather then
the Address? In this case i could create a custom DnsResolver that would
correct the issue.


On Wed, Apr 1, 2015 at 3:08 AM, Oleg Kalnichevski <olegk@apache.org> wrote:

> On Mon, 2015-03-30 at 15:18 -0600, Lucas Sapp wrote:
> > Hello Everyone,
> >
> > I have discovered an issue when I try to reach addresses that do not
> > resolve an IP address but are still valid and can be accessed with a
> > SOCKS/HTTP Proxy. I am using HttpClient 4.3.4. The error seems to occur
> > when it tries to resolve the address prior to connecting the socket. It
> > throws an exception trying to resolve DNS in
> > HttpClientConnectionOperator#Connect. I have verified that by making some
> > changes it will correctly connect to the desired endpoint for SOCKS
> > connections. I was curious to know if there is a better way to handle
> this,
> > and if not, if there was any interest in including this functionality.
> > Thanks,
> > Lucas
> Custom DnsResolver might be what you want.
> Oleg
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
> For additional commands, e-mail: dev-help@hc.apache.org

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message