Skip to content

Run HttpUtilTest's GET request against a local HTTPS server - #587

Open
pacmano1 wants to merge 1 commit into
OpenIntegrationEngine:mainfrom
pacmano1:httputil-test-oie-site
Open

pacmano1 wants to merge 1 commit into
OpenIntegrationEngine:mainfrom
pacmano1:httputil-test-oie-site

Conversation

@pacmano1

@pacmano1 pacmano1 commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #313.

HttpUtilTest.testExecuteGetRequest fetched https://www.nextgen.com, which sent the build machine's address and headers to an outside site on every test run, and failed offline or whenever the site was slow (SocketTimeoutException: Read timed out in local builds).

It now starts an HTTPS server on 127.0.0.1 (the JDK's HttpsServer) with a throwaway self-signed certificate for that address (BouncyCastle, already a dependency), so hostname verification stays on, and checks the body that comes back. The failure case uses a local port with nothing listening instead of a made-up domain, so the test makes no outside call, DNS included.

How to verify

./gradlew :server:test --tests com.mirth.connect.util.HttpUtilTest passes with no network. I ran it in a network namespace with only loopback up.

Tested

  • ./gradlew clean build: 917 tests, 0 failures.
  • With the certificate made for 127.0.0.2 instead, the test fails with SSLPeerUnverifiedException, so it does go through TLS hostname verification.

Co-authored with Claude Code.

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Test Results

  144 files  ±0    144 suites  ±0   3m 43s ⏱️ -9s
  964 tests ±0    964 ✅ ±0  0 💤 ±0  0 ❌ ±0 
1 246 runs  ±0  1 240 ✅ ±0  6 💤 ±0  0 ❌ ±0 

Results for commit 24564eb. ± Comparison against base commit 89f1c03.

♻️ This comment has been updated with latest results.

testExecuteGetRequest fetched https://www.nextgen.com, which sent the
build machine's address and headers to an outside site on every test
run, and failed offline or whenever the site was slow. It now starts an
HTTPS server on 127.0.0.1 with a throwaway self-signed certificate for
that address, so hostname verification stays on, and checks the body
that comes back. The failure case uses a local port with nothing
listening instead of a made-up domain, so the test makes no outside
call, DNS included.

Fixes OpenIntegrationEngine#313

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Finnegan's Owner <44065187+pacmano1@users.noreply.github.com>
@pacmano1
pacmano1 force-pushed the httputil-test-oie-site branch from cd25fb9 to 24564eb Compare November 17, 2026 19:05
@pacmano1 pacmano1 changed the title Point HttpUtilTest's live request at openintegrationengine.org Run HttpUtilTest's GET request against a local HTTPS server Nov 17, 2026
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.

Fix call-home in test run

3 participants