Skip to content

LDEV-6677 HTTP extension, the HTTP engine based on Apache HttpClient 5 - #1

Merged
michaeloffner merged 7 commits into
mainfrom
LDEV-6677-http-extension
Oct 23, 2026
Merged

michaeloffner merged 7 commits into
mainfrom
LDEV-6677-http-extension

Conversation

@michaeloffner

Copy link
Copy Markdown
Contributor

https://luceeserver.atlassian.net/browse/LDEV-6677

Core PR: lucee/Lucee#3262

What

  • Implements lucee.commons.net.http.HTTPClientEngine of the loader with Apache HttpClient 5 (httpclient5, httpcore5, httpcore5-h2, slf4j-api, bundled as Maven dependencies) and registers it with the manifest attribute http-engine.
  • Adds what the built-in engine of the core (java.net.http) can not do: NTLM, restricted headers, connection pool and its statistics, the retry of a pooled connection the server closed, the redirect rules of Lucee 8.
  • Only uses the loader API, no core classes. The TLS configuration (trust store, client certificate, sslverify=false) comes from HTTPUtil.createSSLContext of the core, so the certificates Lucee installed are trusted.

Behaviour

  • Matches HttpClient 4 on the probes of the core PR (methods, forms, multipart, redirects, auth, cookies, gzip, timeouts, TLS). Differences: no Content-Transfer-Encoding for multipart parts, some error messages. A connect time-out is reported as a connection failure (status 0), like before.

Status

  • Needs a Lucee 9 alpha that contains the core change (Lucee PR 3262): luceeCoreVersion in pom.xml and the test matrix in the workflow are still on the previous alpha, so CI can not pass before that release.
  • Tested locally against a jar built from the core branch: the 4 tests of tests/ and the http suite of the core pass with the extension installed.

Implements HTTPClientEngine of the loader and registers it with the manifest attribute http-engine.
- luceeCoreVersion 9.0.0.279-ALPHA in both poms, the first 9.0 alpha on
  Maven Central with the HTTP engine interface (HTTPClientEngine); the
  manifest takes lucee-core-version from it
- the module pom said Apache 2.0, the root pom and License.txt LGPL 2.1
…headers, own redirect loop, bounded TLS pools, no retry of POST

- auth registry with Basic, Digest and NTLM, credentials scoped to the request host (not AuthScope(null,-1)), preemptive Basic only when preauth
- proxy credentials scoped to proxy host and port, default proxy port 80
- redirects handled like the built-in engine (301/302/303 to GET, 307/308 keep method and body, max 50, location validated), credentials not sent to other hosts
- pools keyed by a hash of client certificate/trust store settings (no passwords in the key), LRU with at most 64 pools, evicted pools closed when idle; no client and no evictor thread per request
- TLS context from the loader (same trust store as the core), sslVerify off disables hostname verification
- releaseConnections retires pools under the lock, closeIdleConnections closes expired, idle and retired pools
- retry only idempotent methods after NoHttpResponseException, never on a status code
- supports() only for the documented features
- cookies without domain get the request host
- user Content-Length header ignored, restricted headers (Host, Connection, Expect, Upgrade) sent as set
- bodies streamed, files repeatable, a body on HEAD/TRACE/OPTIONS fails clearly
- a connect timeout is a connection failure (status 0) like the built-in engine, not a 408
…only removed when decoded, content length without consuming the body
…d headers, redirects, cookies, retries and decoding against a recording server
…service, Lucee cfhttp tests (http, cfhttp,ssl) against the extension engine
@michaeloffner
michaeloffner merged commit 291607f into main Oct 23, 2026
7 checks passed
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