You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hop.apache.org by "hansva (via GitHub)" <gi...@apache.org> on 2026/08/05 10:07:09 UTC

[I] [Bug]: http and httppost transform can't reach underscored proxies (hop)

hansva opened a new issue, #7789:
URL: https://github.com/apache/hop/issues/7789

   ### Apache Hop version?
   
   2.18.1
   
   ### Java version?
   
   21
   
   ### Operating system
   
   Windows
   
   ### What happened?
   
   it's a minor issue as it theoretically isn't an allowed DNS hostname
   
   ### Issue Priority
   
   Priority: 2
   
   ### Issue Component
   
   Component: Transforms


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hop.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug]: http and httppost transform can't reach underscored proxies (hop)

Posted by "vbhanuchander-lang (via GitHub)" <gi...@apache.org>.
vbhanuchander-lang commented on issue #7789:
URL: https://github.com/apache/hop/issues/7789#issuecomment-5364054827

   I had a look at this, and the result is slightly different from the title — worth confirming before
   the fix is scoped.
   
   **The proxy leg already tolerates underscores.** Both transforms hand the proxy to
   `HttpClientManager.HttpClientBuilderFacade#setProxy`, which does `new HttpHost(scheme, host, port)`
   and then sets it on `RequestConfig`. That constructor takes the host name verbatim — no URI parsing —
   so `my_proxy.internal` survives it, and I confirmed that against httpcore5 5.4.
   
   **The target URL does not.** `Http#processRow` and `HttpPost#processRow` both do
   `HttpHost.create(uri)`, and that overload reads `URI.getHost()`. When the host name contains an
   underscore, `java.net.URI` treats the authority as registry-based rather than server-based, so:
   
   ```
   http://my_service.internal:8080/api
      URI.getHost()      = null
      URI.getPort()      = -1
      URI.getAuthority() = my_service.internal:8080
   ```
   
   and `HttpHost.create(URI)` fails with `NullPointerException: Host name`. Same call in
   `WebService` and in `HttpProtocol`, so four call sites share it.
   
   So a request *through* an underscored proxy should work, while a request *to* an underscored host
   fails — could you confirm which of the two you actually hit? If it was the target URL then this issue
   covers it and I have a fix ready. If it really was the proxy, I would like to see the stack trace,
   because the code path I traced does not explain it and something else is going on.
   
   On the "not an allowed DNS hostname" point: strictly true, underscores are not legal in hostnames per
   RFC 1123, but they are common in internal networks and container DNS and they resolve fine, so
   failing with a NullPointerException seems the wrong outcome regardless.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org