Skip to content

CAMEL-25941: camel-as2 - support sending through an HTTP proxy - #28265

Merged
davsclaus merged 5 commits into
apache:mainfrom
seshuthota:CAMEL-25941-as2-proxy
Oct 24, 2026
Merged

davsclaus merged 5 commits into
apache:mainfrom
seshuthota:CAMEL-25941-as2-proxy

Conversation

@seshuthota

@seshuthota seshuthota commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Claude Code on behalf of seshuthota

JIRA: CAMEL-25941

Description

The AS2 client can't send through an HTTP proxy today. AS2ClientConnection drives PoolingHttpClientConnectionManager directly with new HttpRoute(targetHost), so HttpClient's route planning never runs, the JVM http(s).proxyHost properties are ignored, and the startup test connection opens a raw socket straight to the partner.

This PR adds four options to the AS2 client endpoint, with the same names and meaning as camel-http (same HttpClient 5 library):

Option Notes
proxyHost When not set, nothing changes.
proxyPort
proxyAuthUsername security = "secret", optional Basic proxy auth: set both credentials or neither
proxyAuthPassword security = "secret"

Behaviour:

  • http target: the request goes to the proxy in absolute form, with a preemptive Proxy-Authorization header when credentials are set.
  • https target: a CONNECT tunnel to the partner, then TLS over it through the connection manager's upgrade(), using the endpoint's sslContext. Hostname verification checks the partner's name, not the proxy's. Proxy-Authorization goes on the CONNECT request only and never reaches the partner.
  • The connection to the proxy is always plain HTTP, whatever the target scheme (the defaulting problem fixed in camel-http by CAMEL-24632).
  • A proxy refusal fails the send: a non-2xx CONNECT, or a 407 on the plain-http path.
  • A connection whose CONNECT or TLS upgrade fails, or that got a 407 on the plain-http path, is closed instead of going back to the pool, so the next send opens a new connection and tunnel.
  • The startup test connection checks the proxy instead of the partner when a proxy is set.
  • Setting only one of proxyAuthUsername / proxyAuthPassword fails the endpoint at startup with an IllegalArgumentException, like a missing proxyPort, instead of skipping authentication and failing later with a 407.
  • The existing AS2ClientConnection constructors keep their behaviour; a new constructor takes the proxy settings.

Left out on purpose (see the ticket): asynchronous MDN delivery stays direct, because its address is chosen by the remote sender and routing it through the operator's proxy deserves its own discussion. Also not included: Digest/NTLM, nonProxyHosts, and CamelContext global proxy options.

Documented in a new "Sending through an HTTP proxy" section of the AS2 component page. Generated files (configurers, as2.json, catalog copies, AS2EndpointBuilderFactory) are regenerated. Because AS2Configuration is shared, the options also appear in the generated configurers of the server endpoint configurations, labelled producer,proxy, as other client-only options do.

Tests

  • New AS2ClientProxyTest (17 tests) with a small in-test forward/CONNECT proxy (TestHttpProxy), which can close the connection after a 407 or keep it open:
    • http through the proxy, and a partner hostname only the proxy can resolve
    • 407 over http and on CONNECT
    • two sends after a refusal, with the proxy closing the connection or keeping it open: each gets its own 407 on a new connection
    • https through the tunnel, checking no Proxy-Authorization reaches the partner
    • sequential and concurrent sends through the tunnel
    • hostname verification through the tunnel, twice: the second send opens a new tunnel
    • an unreachable proxy fails at startup
    • a missing proxyPort gives a clear error
    • only one of the proxy credentials is refused, by AS2ClientConnection and when the endpoint is created (the 3 tests fail without the check)
  • Mutation check: 11 hand-made mutants of the proxy code (no CONNECT, no TLS upgrade, origin-form request to the proxy, credentials leaked into the tunnel, CONNECT status ignored, and so on) are all caught by the tests. So are 3 more for the connection-reuse fix: no close after a failed CONNECT or upgrade, no close after a failed upgrade only, no close after a plain-http 407.
  • Manually against a real Squid 6.13 with Basic auth:
    • all 23 AS2MessageTest cases (signed, encrypted, compressed, combined) over http and https
    • wrong passwords, and a partner only Squid can resolve
    • 3 sends in a row with a wrong password, over http and https: each gets a 407 on a new connection. Before the fix, the second https send went out on the untunnelled connection and returned no error.
    • 20 sequential and 64 concurrent sends per protocol; https reused 8 pooled tunnels
    • recovery after a Squid restart
  • Full camel-as2 build, after merging main (CAMEL-25918, CAMEL-25918: camel-as2 - consumers sharing a port use their own asynchronous MDN settings #28274): 107 (api) + 36 (component, 1 skipped as before) + 111 (integration) tests pass. Formatter and impsort applied.

🤖 Generated with Claude Code

https://claude.ai/code/session_0132kd6FojYDmowiTV4jkrvW

Add proxyHost, proxyPort, proxyAuthUsername and proxyAuthPassword options
to the AS2 client. Plain http is sent to the proxy in absolute form; https
goes through a CONNECT tunnel, with TLS and hostname verification against
the target. Proxy credentials are sent preemptively to the proxy only, and
a proxy refusal (407) fails the send. Asynchronous MDN delivery is not
affected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

🌟 Thank you for your contribution to the Apache Camel project! 🌟
🤖 CI automation will test this PR automatically.

🐫 Apache Camel Committers, please review the following items:

  • First-time contributors require MANUAL approval for the GitHub Actions to run
  • You can use the command /component-test (camel-)component-name1 (camel-)component-name2.. to request a test from the test bot although they are normally detected and executed by CI.
  • You can label PRs using skip-tests and test-dependents to fine-tune the checks executed by this PR.
  • Build and test logs are available in the summary page. Only Apache Camel committers have access to the summary.

⚠️ Be careful when sharing logs. Review their contents before sharing them publicly.

@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

🧪 CI tested the following changed modules:

  • catalog/camel-catalog
  • components/camel-as2/camel-as2-api
  • components/camel-as2/camel-as2-component
  • dsl/camel-endpointdsl

🔁 1 test passed only after a retry on JDK 21 (1 retried attempt)

Recovered flaky tests on JDK 21 (1)
Module Test Failed attempts First failure
dsl/camel-jbang/camel-jbang-plugin-tui LaunchManagerOutcomeTest.startedWhenTheStatusFileSaysSo 1 expected: null but was: LaunchOutcome[ok=false, log=null]

ℹ️ These tests did not fail the build. Surefire retried them and they passed.
Retries are enabled project-wide by surefire.rerunFailingTestsCount in parent/pom.xml.


🔬 Scalpel shadow comparison — Scalpel: 9 of 707 tested, 25 compile-only — current: 9 all tested

Maveniverse Scalpel detected 9 affected modules (current approach: 9).

Skip-tests mode would test 9 modules (4 direct + 7 downstream), skip tests for 25 (generated code, meta-modules)

Modules Scalpel would test (9)
  • camel-as2 ← components/camel-as2/camel-as2-component/src/generated/java/org/apache/camel/component/as2/AS2AsyncMDNServerManagerEndpointConfigurationConfigurer.java, components/camel-as2/camel-as2-component/src/generated/java/org/apache/camel/component/as2/AS2ClientManagerEndpointConfigurationConfigurer.java, components/camel-as2/camel-as2-component/src/generated/java/org/apache/camel/component/as2/AS2ConfigurationConfigurer.java, components/camel-as2/camel-as2-component/src/generated/java/org/apache/camel/component/as2/AS2EndpointConfigurer.java, components/camel-as2/camel-as2-component/src/generated/java/org/apache/camel/component/as2/AS2EndpointUriFactory.java, components/camel-as2/camel-as2-component/src/generated/java/org/apache/camel/component/as2/AS2ServerManagerEndpointConfigurationConfigurer.java, components/camel-as2/camel-as2-component/src/generated/resources/META-INF/org/apache/camel/component/as2/as2.json, components/camel-as2/camel-as2-component/src/main/docs/as2-component.adoc, components/camel-as2/camel-as2-component/src/main/java/org/apache/camel/component/as2/AS2Configuration.java, components/camel-as2/camel-as2-component/src/main/java/org/apache/camel/component/as2/internal/AS2ConnectionHelper.java, components/camel-as2/camel-as2-component/src/test/java/org/apache/camel/component/as2/AS2ClientProxyTest.java, components/camel-as2/camel-as2-component/src/test/java/org/apache/camel/component/as2/TestHttpProxy.java
  • camel-as2-api ← components/camel-as2/camel-as2-api/src/main/java/org/apache/camel/component/as2/api/AS2ClientConnection.java
  • camel-jbang-mcp ← downstream of org.apache.camel:camel-catalog
  • camel-jbang-plugin-mcp ← downstream of org.apache.camel:camel-jbang-core
  • camel-jbang-plugin-tui ← downstream of org.apache.camel:camel-catalog
  • camel-jbang-plugin-validate ← downstream of org.apache.camel:camel-yaml-dsl-validator
  • camel-launcher-container ← downstream of org.apache.camel:camel-launcher
  • camel-yaml-dsl-validator ← downstream of org.apache.camel:camel-catalog
  • camel-yaml-dsl-validator-maven-plugin ← downstream of org.apache.camel:camel-yaml-dsl-validator
Modules with tests skipped (25)
  • apache-camel
  • camel-allcomponents
  • camel-catalog-console
  • camel-catalog-maven
  • camel-catalog-suggest
  • camel-componentdsl
  • camel-endpointdsl-support
  • camel-itest
  • camel-jbang-core
  • camel-jbang-it
  • camel-jbang-main
  • camel-jbang-plugin-edit
  • camel-jbang-plugin-generate
  • camel-jbang-plugin-kubernetes
  • camel-jbang-plugin-test
  • camel-kamelet-main
  • camel-launcher
  • camel-report-maven-plugin
  • camel-route-parser
  • camel-yaml-dsl
  • camel-yaml-dsl-deserializers
  • camel-yaml-dsl-maven-plugin
  • coverage
  • docs
  • dummy-component

ℹ️ Shadow mode — Scalpel observes but does not affect test execution. Learn more

All tested modules (36 modules, 5m 56s total)

Total reactor time: 5m 56s

Module Duration Status
Camel :: JBang :: Plugin :: TUI 57.5s SUCCESS
Camel :: Component DSL 38.8s SUCCESS
Camel :: AS2 :: Component 38.2s SUCCESS
Camel :: Launcher 27.7s SUCCESS
Camel :: JBang :: Plugin :: Validate 25.0s SUCCESS
Camel :: JBang :: MCP 19.2s SUCCESS
Camel :: YAML DSL 18.9s SUCCESS
Camel :: Catalog :: Camel Catalog 17.2s SUCCESS
Camel :: YAML DSL :: Validator 16.6s SUCCESS
Camel :: AS2 :: API 12.6s SUCCESS
Camel :: Kamelet Main 11.6s SUCCESS
Camel :: Docs 10.4s SUCCESS
Camel :: JBang :: Plugin :: Kubernetes 9.0s SUCCESS
Camel :: Catalog :: Camel Report Maven Plugin 7.1s SUCCESS
Camel :: JBang :: Plugin :: Testing 6.7s SUCCESS
Camel :: Catalog :: Camel Route Parser 6.1s SUCCESS
Camel :: Catalog :: Suggest (deprecated) 5.8s SUCCESS
Camel :: YAML DSL :: Deserializers 5.8s SUCCESS
Camel :: All Components Sync point 3.9s SUCCESS
Camel :: YAML DSL :: Validator Maven Plugin 3.4s SUCCESS
Camel :: Catalog :: Maven 2.6s SUCCESS
Camel :: YAML DSL :: Maven Plugins 2.4s SUCCESS
Camel :: Assembly 1.3s SUCCESS
Camel :: Catalog :: Dummy Component 1.3s SUCCESS
Camel :: JBang :: Plugin :: Edit 1.1s SUCCESS
Camel :: JBang :: Integration tests 1.0s SUCCESS
Camel :: JBang :: Plugin :: Generate 0.9s SUCCESS
Camel :: Coverage 0.9s SUCCESS
Camel :: Catalog :: Console 0.7s SUCCESS
Camel :: JBang :: Main 0.6s SUCCESS
Camel :: Endpoint DSL :: Support 0.6s SUCCESS
Camel :: Launcher :: Container 0.5s SUCCESS
Camel :: JBang :: Plugin :: MCP 0.4s SUCCESS
Camel :: Endpoint DSL n/a
Camel :: Integration Tests n/a
Camel :: JBang :: Core n/a

Top 20 slowest modules:

  • Camel :: JBang :: Plugin :: TUI (57.5s)
  • Camel :: Component DSL (38.8s)
  • Camel :: AS2 :: Component (38.2s)
  • Camel :: Launcher (27.7s)
  • Camel :: JBang :: Plugin :: Validate (25.0s)
  • Camel :: JBang :: MCP (19.2s)
  • Camel :: YAML DSL (18.9s)
  • Camel :: Catalog :: Camel Catalog (17.2s)
  • Camel :: YAML DSL :: Validator (16.6s)
  • Camel :: AS2 :: API (12.6s)
  • Camel :: Kamelet Main (11.6s)
  • Camel :: Docs (10.4s)
  • Camel :: JBang :: Plugin :: Kubernetes (9.0s)
  • Camel :: Catalog :: Camel Report Maven Plugin (7.1s)
  • Camel :: JBang :: Plugin :: Testing (6.7s)
  • Camel :: Catalog :: Camel Route Parser (6.1s)
  • Camel :: Catalog :: Suggest (deprecated) (5.8s)
  • Camel :: YAML DSL :: Deserializers (5.8s)
  • Camel :: All Components Sync point (3.9s)
  • Camel :: YAML DSL :: Validator Maven Plugin (3.4s)

⚙️ View full build and test results

@Croway

Croway commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

there is a test error:

[camel-yaml-dsl-validator] [ERROR] Tests run: 4, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 5.824 s <<< FAILURE! -- in org.apache.camel.dsl.yaml.validator.EipDocExamplesTest
[camel-yaml-dsl-validator] [ERROR] org.apache.camel.dsl.yaml.validator.EipDocExamplesTest.everyYamlExampleOfTheComponentDocumentationValidates -- Time elapsed: 3.432 s <<< FAILURE!
java.lang.AssertionError: 
[Component documentation examples that do not validate] 
Expecting empty but was: ["as2-component example 2: property 'to' is not defined in the schema and the schema does not allow additional properties"]
	at org.apache.camel.dsl.yaml.validator.EipDocExamplesTest.everyYamlExampleOfTheComponentDocumentationValidates(EipDocExamplesTest.java:106)
[camel-yaml-dsl-validator] [INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 5.652 s -- in org.apache.camel.dsl.yaml.validator.YamlRoundTripTest
[camel-yaml-dsl-validator] [INFO] Running org.apache.camel.dsl.yaml.validator.EipDocExamplesTest
[camel-yaml-dsl-validator] [ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 1.024 s <<< FAILURE! -- in org.apache.camel.dsl.yaml.validator.EipDocExamplesTest
[camel-yaml-dsl-validator] [ERROR] org.apache.camel.dsl.yaml.validator.EipDocExamplesTest.everyYamlExampleOfTheComponentDocumentationValidates -- Time elapsed: 0.988 s <<< FAILURE!
java.lang.AssertionError: 
[Component documentation examples that do not validate] 
Expecting empty but was: ["as2-component example 2: property 'to' is not defined in the schema and the schema does not allow additional properties"]
	at org.apache.camel.dsl.yaml.validator.EipDocExamplesTest.everyYamlExampleOfTheComponentDocumentationValidates(EipDocExamplesTest.java:106)
[camel-yaml-dsl-validator] [INFO] Running org.apache.camel.dsl.yaml.validator.EipDocExamplesTest
[camel-yaml-dsl-validator] [ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.845 s <<< FAILURE! -- in org.apache.camel.dsl.yaml.validator.EipDocExamplesTest
[camel-yaml-dsl-validator] [ERROR] org.apache.camel.dsl.yaml.validator.EipDocExamplesTest.everyYamlExampleOfTheComponentDocumentationValidates -- Time elapsed: 0.804 s <<< FAILURE!
java.lang.AssertionError: 
[Component documentation examples that do not validate] 
Expecting empty but was: ["as2-component example 2: property 'to' is not defined in the schema and the schema does not allow additional properties"]
	at org.apache.camel.dsl.yaml.validator.EipDocExamplesTest.everyYamlExampleOfTheComponentDocumentationValidates(EipDocExamplesTest.java:106)
	```

The YAML DSL validator checks every YAML example in the component
documentation; a bare "to" step is not a valid route.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0132kd6FojYDmowiTV4jkrvW
@seshuthota

Copy link
Copy Markdown
Contributor Author

Thanks @Croway! Fixed in f226e50: the YAML proxy example in the AS2 docs was a bare to step; it's now a complete route (from: direct:sendToPartner → to: as2://client/send), in the component doc and the catalog copy. EipDocExamplesTest passes locally (4/4). Could you approve the CI workflows again when you have a moment?

@seshuthota
seshuthota marked this pull request as ready for review October 23, 2026 03:09
@seshuthota

Copy link
Copy Markdown
Contributor Author

CI is green and the YAML doc example is fixed. @gnodet @davsclaus, could you take a look when you have time?

@davsclaus davsclaus left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TL;DR

Request changes: the proxy support is well put together, but a refused CONNECT leaves an untunnelled connection in the pool. The next send then skips the tunnel and TLS.

Blockers

  • AS2ClientConnection.java:240-246: when CONNECT or the TLS upgrade fails, the connection goes back to the pool and still counts as connected.

Other findings: 2 non-blocking, 1 suggestion. See below.


Thanks @seshuthota, this is a careful piece of work. Some things I liked:

  • The option names, labels and security = "secret" match camel-http, so users of both components see the same options.
  • On the tunnel path, Proxy-Authorization goes on the CONNECT only, hostname verification checks the partner's name, and both are tested.
  • The generated files and the catalog copies are regenerated. The new doc section is clear, and it says plainly that asynchronous MDN delivery is out of scope.

CI is green.

Blocking

1. A failed CONNECT or TLS upgrade puts the connection back in the pool as connected (AS2ClientConnection.java:240-246)

When the proxy refuses the tunnel, createTunnel throws and response stays null. The finally block then releases the endpoint with TimeValue.ZERO_MILLISECONDS (line 270). In HttpClient 5, PoolingHttpClientConnectionManager.release() closes the connection only when keepAlive is null. With ZERO, an open and consistent connection is put back as reusable, and PoolEntry.updateExpiry() makes it never expire: Deadline.calculate() returns MAX_VALUE for a non-positive value. The IOHelper.close(endpoint) after the release does nothing, because the endpoint is already detached.

An unread 407 body on the CONNECT response does not make the connection inconsistent, since isConsistent() only tracks the request entity. isConnected() only checks that a socket is bound. So the next send() on that pool:

  • gets a connection that counts as connected
  • skips createTunnel and upgrade
  • writes the AS2 request in origin form, in plain text, on the proxy connection. It then parses the leftover 407 body as its response.

A wrong proxyAuthPassword makes this happen on every second send, and so does any proxy that keeps the connection open after refusing a CONNECT. The lease check does not help. It only looks for stale connections after 2s of idle time (the default validateAfterInactivity), and a stale check cannot tell a refused tunnel from a good one anyway.

A failed TLS upgrade has the same shape. AbstractClientTlsStrategy closes the SSL socket, but the plain socket is still bound to the connection, so it stays "connected". The next send then fails with a socket-closed error instead of making a fresh CONNECT and handshake.

The tests do not catch this. TestHttpProxy answers 407 with Connection: close, and each refusal test sends only once.

Suggested fix, inline: close the connection whenever connect, tunnel or upgrade fails (it needs import org.apache.hc.core5.io.CloseMode;). Separately, the comment at lines 268-270 says "do NOT keep this connection around", but ZERO keeps it. Passing null there is what actually closes it. That finally block is older than this PR and also covers the direct path, so fixing it here is optional.

Non-blocking

2. 407 on the plain-http path (AS2ClientConnection.java:281-286): the check runs after the finally block has already released the connection to the pool with the keep-alive from the strategy. If the proxy keeps that connection open, the 407 body may still be unread when the next request uses it. One fix is to do the check inside the try and close the endpoint before throwing. Another is to release with a null keep-alive for a proxy 407.

3. Tests for a second send after a refusal (inline on AS2ClientProxyTest.java:207): send twice through the wrong-password tunnel route, and expect a 407 both times and two CONNECT lines at the proxy. This fails today and passes with the fix. Optionally, TestHttpProxy could also keep the client connection open after a 407, as real proxies often do. A second send after verifiesTheTargetHostNameThroughTheTunnel should likewise fail with an SSLException again.

Suggestions

4. #28274 (CAMEL-25918) also touches AS2Configuration, as2.json, as2-component.adoc and AS2EndpointBuilderFactory. Whichever PR merges second needs a rebase, and the generated files need regenerating.

Claude Code on behalf of @davsclaus. This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.

… instead of pooling it

A refused CONNECT or a failed TLS upgrade released the connection to the
pool with a zero keep-alive, which HttpClient keeps open with no expiry.
The next send then skipped CONNECT and TLS and wrote the AS2 request in
plain text to the proxy. Close the connection when connect, tunnel or
upgrade fails, and when the proxy answers 407 on the plain-http path.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0132kd6FojYDmowiTV4jkrvW
@seshuthota

Copy link
Copy Markdown
Contributor Author

Thanks for the thorough review @davsclaus! All three points are addressed in d6423fe, details in the threads. On #28274: no conflict with main for now. If it merges first, I'll rebase and regenerate. Could a committer approve the CI workflows for the new commit?

Claude Code on behalf of @seshuthota

@davsclaus davsclaus left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @seshuthota, all three points are addressed in d6423fe.

  • Failed tunnel or upgrade: AS2ClientConnection.java:241-254 now closes the endpoint with CloseMode.IMMEDIATE when connect, CONNECT or the TLS upgrade fails. The entry goes back to the pool without a connection, so the next send makes a fresh CONNECT and handshake.
  • Plain-http 407: the check now runs inside the try (lines 268-276) and closes the endpoint before throwing, so an unread 407 body cannot reach the next request.
  • Tests: refusedTunnelIsNotReused and refusedHttpConnectionIsNotReused, with their keep-alive variants, assert two 407s, two request lines and two proxy connections, and would fail without the fix. Sending twice in verifiesTheTargetHostNameThroughTheTunnel covers the failed handshake too. The keep-alive mode of TestHttpProxy is a nice touch.

Could you link the JIRA for the Connection: close pooling issue on the direct path once it is filed? That follow-up is also a good place to change the ZERO_MILLISECONDS release in the finally (lines 284-290) to null: its comment says the connection is not kept, but with ZERO it is.

LGTM once CI is green.

Reviewed with Claude Code on behalf of davsclaus. This review was generated by an AI agent and may contain inaccuracies; please verify all suggestions before applying.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0132kd6FojYDmowiTV4jkrvW

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Solid proxy implementation — correct HTTP/HTTPS proxy semantics, proper connection cleanup on failure, and thorough test coverage. One minor usability note below.

This review was generated by an AI agent, Hermès on behalf of @gnodet.

…ssword, or the reverse

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0132kd6FojYDmowiTV4jkrvW
@seshuthota

Copy link
Copy Markdown
Contributor Author

Addressed the note from the automated review in 5f9144e: setting only one of the proxy credentials now fails the endpoint at startup (details in the thread). Could a committer approve the CI workflows for the new commit?

Claude Code on behalf of @seshuthota

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Approval — CAMEL-25941: camel-as2 proxy support

The implementation is clean and well-tested:

  • AS2ClientConnection correctly validates that proxyAuthUsername and proxyAuthPassword are always set together, throwing IllegalArgumentException with a clear message
  • The new AS2ClientProxyTest covers proxy auth validation, tunnel failures, connection reuse, and concurrency (15+ tests)
  • The catch block in the connection setup properly re-throws after closing the endpoint — no silent swallowing

No issues found.

This review was generated by an AI agent, Hermès on behalf of @gnodet.

@davsclaus davsclaus left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TL;DR

The new commit is correct: setting only one proxy credential now fails when the endpoint is created, with a clear message. Good to merge once CI is green.

Blockers: None

Other findings: 0

Thanks @seshuthota, this answers the point from the automated review well.

  • AS2ClientConnection.java:128-131: the check runs before the connection pool is built, so nothing is left open when it throws. It applies only when proxyHost is set, and the older constructors pass null for both credentials, so existing users see no change.
  • AS2Endpoint creates the client connection in afterConfigureProperties, so the route fails at startup, as the new sentence in as2-component.adoc says. The catalog copy is in sync.
  • The three new tests in AS2ClientProxyTest cover each credential alone and the endpoint path.
  • The merge of main changed nothing in this PR's own files, apart from the regenerated as2.json rows that now carry the option descriptions from CAMEL-25918. The merge also brings httpclient 5.6.5, so the CI run that is starting now is the first one of the proxy tests on it.

Reviewed with Claude Code on behalf of @davsclaus. This review was generated by an AI agent and may contain inaccuracies; please verify all suggestions before applying.

@davsclaus davsclaus added this to the 4.24.0 milestone Oct 24, 2026
@davsclaus davsclaus added the enhancement New feature or request label Oct 24, 2026
@davsclaus
davsclaus merged commit 4c4f6fb into apache:main Oct 24, 2026
7 checks passed
@seshuthota
seshuthota deleted the CAMEL-25941-as2-proxy branch October 24, 2026 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants