[
https://issues.apache.org/jira/browse/HTTPCLIENT-2350?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17898885#comment-17898885
]
ASF subversion and git services commented on HTTPCLIENT-2350:
-------------------------------------------------------------
Commit 0b56a628c5b4b1aa24908599bd037afedf515807 in httpcomponents-client's
branch refs/heads/master from Arturo Bernal
[ https://gitbox.apache.org/repos/asf?p=httpcomponents-client.git;h=0b56a628c ]
HTTPCLIENT-2350 - Refactored the connect method in
DefaultHttpClientConnectionOperator to enhance flexibility in address
resolution, specifically allowing for direct handling of unresolved addresses.
Updated DnsResolver to introduce a new resolve method supporting both standard
and bypassed DNS lookups, enabling improved support for non-public resolvable
hosts like .onion endpoints via SOCKS proxy. Adjusted related tests to align
with the new resolution mechanism. (#598)
> Option to prevent hostname resolution to InetAddress
> ----------------------------------------------------
>
> Key: HTTPCLIENT-2350
> URL: https://issues.apache.org/jira/browse/HTTPCLIENT-2350
> Project: HttpComponents HttpClient
> Issue Type: Improvement
> Components: HttpClient (classic)
> Affects Versions: 5.4.1
> Reporter: namloan
> Priority: Major
> Fix For: 5.5-alpha1
>
> Time Spent: 2h 10m
> Remaining Estimate: 0h
>
> In Bisq2 [1] we are querying .onion endpoints through HTTP to retrieve some
> data. To do this, it's needed to connect to through a SOCKS proxy and let it
> resolve the hostname through the Tor network as a public DNS resolution will
> fail. In HTTP client 4.x we had it implemented as explained in [2]- using a
> FakeDNSResolver and custom socket factories that do not try to resolve the
> .onion hostname to an InetAddress.
>
> We've just migrated to HttpClient 5.4.1. Finding out how to do this required
> extensive hours of debugging the library, in particular preventing the public
> DNS resolution as custom socket factories are deprecated. Find our solution
> in [3]. In essence, we created our own PoolingTorHttpClientConnectionManager
> to be able to inject our own HttpClientConnectionOperator that doesn't
> attempt to resolve the .onion hostname to an InetAddress [4]
> Is there a simpler way to do this? If not, it would be great to count on a
> simpler option so that we can remove our own connection manager and
> connection operator given that they are mostly duplicated code from the
> library.
>
> [1] [https://github.com/bisq-network/bisq2]
> [2]
> [http://stackoverflow.com/a/25203021/5616248|http://stackoverflow.com/a/25203021/5616248)]
> [3]
> [https://github.com/bisq-network/bisq2/pull/2990/commits/f93ece314fd16036e0d748ce2c6d9f79ba10e762]
> [4]
> [https://github.com/bisq-network/bisq2/blob/main/network/network/src/main/java/bisq/network/http/TorHttpClientConnectionOperator.java#L117-L119]
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]