Skip to content

Add Vert.x HTTP client as v2 alternative to Apache HTTP client - #51638

Draft
Pepo48 wants to merge 1 commit into
keycloak:mainfrom
Pepo48:issue-49968
Draft

Add Vert.x HTTP client as v2 alternative to Apache HTTP client#51638
Pepo48 wants to merge 1 commit into
keycloak:mainfrom
Pepo48:issue-49968

Conversation

@Pepo48

@Pepo48 Pepo48 commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Adds a Vert.x-based HTTP client for outbound connections, opt-in via --features=http-client:v2. The existing Apache client stays as the default.

The Vert.x client shares the same config properties as Apache, switching requires only enabling the feature. It supports TLS (truststore + mTLS), proxy with NO_PROXY, connection pooling, retries with exponential backoff and OpenSSL detection with a configurable startup policy (warn/fail/none) for future PQC enforcement.

For backward compatibility, getHttpClient() returns a bridge that wraps Vert.x behind Apache's CloseableHttpClient API. Eight direct Apache callers were migrated to SimpleHttp.

Edit:
Just for the clarity, here are what I consider to be the next steps (in the given order):

  1. performance benchmark - listed as an issue goal but imo the proper perf testing should be a separate task.
  2. graduate v2 from PREVIEW to DEFAULT.
  3. deprecate Apache, remove the bridge - could be avoided in this PR by adding provider-neutral methods to the SPI, but expanding the interface for a transitional problem didn't seem right.
  4. remove Apache from server-spi-private, rewrite SimpleHttp internals - could be also done as a part of this PR, but SimpleHttp lives in a platform-independent module that can't import Vert.x, it would require an execution abstraction that only makes sense after Apache is deprecated.

Let me definitely know, whether these make sense as follow-ups.

Closes #49968

@keycloak-github-bot keycloak-github-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Unreported flaky test detected, please review

@keycloak-github-bot

Copy link
Copy Markdown

Unreported flaky test detected

If the flaky tests below are affected by the changes, please review and update the changes accordingly. Otherwise, a maintainer should report the flaky tests prior to merging the PR.

org.keycloak.testsuite.webauthn.passwordless.WebAuthnPwdLessPropertyTest#timeout

Keycloak CI - WebAuthn IT

org.openqa.selenium.WebDriverException: 
unknown error: unhandled inspector error: {"code":-32000,"message":"Node with given id does not belong to the document"}
  (Session info: chrome=150.0.7871.128)
Build info: version: '4.28.1', revision: '73f5ad48a2'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.17.0-1020-azure', java.version: '25.0.3'
...

Report flaky test

Closes keycloak#49968

Signed-off-by: Peter Zaoral <pzaoral@redhat.com>
@keycloak-github-bot

Copy link
Copy Markdown

Unreported flaky test detected

If the flaky tests below are affected by the changes, please review and update the changes accordingly. Otherwise, a maintainer should report the flaky tests prior to merging the PR.

org.keycloak.testsuite.federation.ldap.LDAPGroupMapperTest#test01_ldapOnlyGroupMappings

Keycloak CI - Base IT (5)

org.opentest4j.AssertionFailedError: expected: <4> but was: <3>
	at org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
	at org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
	at org.junit.jupiter.api.AssertEquals.failNotEqual(AssertEquals.java:197)
	at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:150)
...

Report flaky test

@keycloak-github-bot keycloak-github-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Unreported flaky test detected, please review

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.

Switch internal HTTP client from Apache to Vert.x/Netty

1 participant