Skip to content

http-pqc-j21: Replace httpclient5 test dependency with RestAssured - #559

Merged
jamesnetherton merged 2 commits into
apache:camel-quarkus-mainfrom
jamesnetherton:quick-fix/http-pqc-j21-drop-httpclient5
Aug 7, 2026
Merged

http-pqc-j21: Replace httpclient5 test dependency with RestAssured#559
jamesnetherton merged 2 commits into
apache:camel-quarkus-mainfrom
jamesnetherton:quick-fix/http-pqc-j21-drop-httpclient5

Conversation

@jamesnetherton

@jamesnetherton jamesnetherton commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Removed the httpclient5 test-scoped dependency from the http-pqc-j21 example
  • Rewrote the provider-specific TLS tests to use RestAssured's SSLConfig.sslSocketFactory() backed by a provider-specific SSLContext, instead of httpclient5's SSLConnectionSocketFactory
  • The explicit setNamedGroups() call was unnecessary since both BCJSSE and SunJSSE already read named groups from the jdk.tls.namedGroups system property set by the test profiles

Test plan

  • mvn verify passes — all 6 tests green (3 in PqcWithFallbackTest, 3 in PqcOnlyTest)
  • Verify native mode tests still pass with -Dnative

🤖 Generated with Claude Code

…ured

The httpclient5 dependency was only used in tests to select a specific
JSSE provider and set TLS named groups. Both can be achieved with
RestAssured's SSLConfig.sslSocketFactory() backed by a provider-specific
SSLContext, since the named groups are already controlled by the
jdk.tls.namedGroups system property set by the test profiles.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

@JiriOndrusek JiriOndrusek 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.

Minor security observation — not blocking.

This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.

} else {
assertTrue(responseStatus == 200, "Expected response status is 200");
}
SSLSocketFactory sslSocketFactory = new SSLSocketFactory(sslContext);

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.

new SSLSocketFactory(sslContext) has two issues:

  1. Defaults to BROWSER_COMPATIBLE_HOSTNAME_VERIFIER (lenient) instead of strict
  2. Does not constrain the socket to TLS 1.3 — client could negotiate TLS 1.2, bypassing PQC
Suggested change
SSLSocketFactory sslSocketFactory = new SSLSocketFactory(sslContext);
SSLSocketFactory sslSocketFactory = new SSLSocketFactory(
sslContext,
new String[] { "TLSv1.3" },
null,
SSLSocketFactory.STRICT_HOSTNAME_VERIFIER);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good catch on both points. Fixed in 7fd7a01 — now using the 4-arg constructor with STRICT_HOSTNAME_VERIFIER and TLSv1.3 protocol constraint.

…S 1.3

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jamesnetherton
jamesnetherton merged commit 205026b into apache:camel-quarkus-main Aug 7, 2026
4 checks passed
@jamesnetherton
jamesnetherton deleted the quick-fix/http-pqc-j21-drop-httpclient5 branch August 7, 2026 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants