Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Feb 9, 2026

Maven builds fail with "Unsupported or unrecognized SSL message" when accessing repo.maven.apache.org through AWF. Java applications ignore HTTP_PROXY/HTTPS_PROXY environment variables and require JVM system properties.

Changes

  • src/docker-manager.ts: Set JAVA_TOOL_OPTIONS with Java proxy properties (-Dhttp.proxyHost, -Dhttps.proxyHost, etc.) pointing to Squid at container startup
  • src/docker-manager.ts: Add -Dhttp.nonProxyHosts for localhost bypass when host access enabled
  • src/docker-manager.test.ts: Add unit tests verifying proxy configuration
  • .github/workflows/build-test-java.md: Add validation steps to verify Java proxy configuration before running Maven tests, including display of actual JVM proxy properties and expected configuration values

Technical Details

AWF sets HTTP_PROXY/HTTPS_PROXY for tools like curl and npm, but Java's networking stack requires explicit JVM properties. Without them, Maven attempts direct connections that get transparently redirected by iptables to Squid, which then receives raw SSL handshake data instead of HTTP CONNECT requests.

Example configuration applied:

JAVA_TOOL_OPTIONS="-Dhttp.proxyHost=172.30.0.10 -Dhttp.proxyPort=3128 -Dhttps.proxyHost=172.30.0.10 -Dhttps.proxyPort=3128"

This environment variable is automatically picked up by all JVMs (Maven, Gradle, Java applications) running in the agent container.

Workflow Validation

The build-test-java workflow now includes a verification step that:

  • Displays the JAVA_TOOL_OPTIONS environment variable value
  • Uses java -XshowSettings:properties to show actual JVM proxy configuration
  • Reports proxy configuration status in the workflow output
  • Fails if proxy settings are missing or incorrect

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 3 commits February 9, 2026 16:31
Maven and other Java tools don't automatically respect HTTP_PROXY/HTTPS_PROXY
environment variables. They require Java system properties to configure proxy settings.

This fix adds JAVA_TOOL_OPTIONS environment variable to automatically configure
Java proxy settings for all JVMs running in the agent container:
- Sets http.proxyHost and http.proxyPort for HTTP traffic
- Sets https.proxyHost and https.proxyPort for HTTPS traffic
- Adds http.nonProxyHosts when host access is enabled

This resolves the "Unsupported or unrecognized SSL message" error that Maven
was experiencing when trying to access repo.maven.apache.org through AWF.

Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
Added unit tests to verify that JAVA_TOOL_OPTIONS environment variable
is correctly configured with Java proxy settings:
- Base proxy configuration (proxyHost, proxyPort for HTTP/HTTPS)
- Non-proxy hosts configuration when host access is enabled

All 139 tests in docker-manager.test.ts pass.

Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
- Use explicit concatenation instead of += to avoid potential undefined errors
- Add comment explaining why 127.0.0.1 is included despite Java IP address limitation
Copilot AI changed the title [WIP] Fix broken pipeline to run build and test Java fix: configure Java proxy via JAVA_TOOL_OPTIONS for Maven builds Feb 9, 2026
@Mossaka Mossaka marked this pull request as ready for review February 9, 2026 16:55
Copilot AI review requested due to automatic review settings February 9, 2026 16:55
@github-actions
Copy link
Contributor

github-actions bot commented Feb 9, 2026

Chroot tests failed Smoke Chroot failed - See logs for details.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 9, 2026

📰 DEVELOPING STORY: Smoke Copilot reports failed. Our correspondents are investigating the incident...

@github-actions
Copy link
Contributor

github-actions bot commented Feb 9, 2026

💫 TO BE CONTINUED... Smoke Claude failed! Our hero faces unexpected challenges...

@github-actions
Copy link
Contributor

github-actions bot commented Feb 9, 2026

✅ Coverage Check Passed

Overall Coverage

Metric Base PR Delta
Lines 82.02% 82.02% ➡️ +0.00%
Statements 82.06% 82.06% ➡️ +0.00%
Functions 81.95% 81.95% ➡️ +0.00%
Branches 75.51% 75.51% ➡️ +0.00%

Coverage comparison generated by scripts/ci/compare-coverage.ts

@github-actions
Copy link
Contributor

github-actions bot commented Feb 9, 2026

Build Test: Rust - FAILED ❌

Clone Error: Unable to clone test repository Mossaka/gh-aw-firewall-test-rust

Error Details:

fatal: unable to access 'https://github.com/Mossaka/gh-aw-firewall-test-rust.git/': 
The requested URL returned error: 502

The test repository could not be accessed due to a network error (502 Bad Gateway). Please verify:

  • Repository exists and is accessible
  • Network connectivity is properly configured
  • Repository URL is correct

Overall Status: FAILED

AI generated by Build Test Rust

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Configure Java/JVM-based tooling (Maven/Gradle) to use the Squid proxy by injecting JVM proxy system properties via JAVA_TOOL_OPTIONS, addressing Maven SSL failures behind AWF.

Changes:

  • Add JAVA_TOOL_OPTIONS with http(s).proxyHost/proxyPort to the agent container environment.
  • When host access is enabled, append Java-specific non-proxy host configuration.
  • Add unit tests asserting Java proxy env configuration is present and updated with host access.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/docker-manager.ts Injects JVM proxy configuration via JAVA_TOOL_OPTIONS, and adds Java non-proxy hosts when host access is enabled.
src/docker-manager.test.ts Adds tests validating the new JAVA_TOOL_OPTIONS behavior in compose generation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

// for localhost connections that may use the IP address directly
const javaNoProxy = `localhost|127.0.0.1|host.docker.internal`;
// Append Java-specific NO_PROXY settings to JAVA_TOOL_OPTIONS (which is guaranteed to exist)
environment.JAVA_TOOL_OPTIONS = `${environment.JAVA_TOOL_OPTIONS} -Dhttp.nonProxyHosts="${javaNoProxy}"`;
Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

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

The quotes around the http.nonProxyHosts value may be treated as literal characters when parsed from JAVA_TOOL_OPTIONS (parsing behavior can differ from typical shell tokenization), which would break host matching (e.g., "localhost|..." instead of localhost|...). Prefer setting -Dhttp.nonProxyHosts=${javaNoProxy} without embedded quotes to avoid misparsing.

Suggested change
environment.JAVA_TOOL_OPTIONS = `${environment.JAVA_TOOL_OPTIONS} -Dhttp.nonProxyHosts="${javaNoProxy}"`;
environment.JAVA_TOOL_OPTIONS = `${environment.JAVA_TOOL_OPTIONS} -Dhttp.nonProxyHosts=${javaNoProxy}`;

Copilot uses AI. Check for mistakes.
Comment on lines 326 to 334
const environment: Record<string, string> = {
HTTP_PROXY: `http://${networkConfig.squidIp}:${SQUID_PORT}`,
HTTPS_PROXY: `http://${networkConfig.squidIp}:${SQUID_PORT}`,
// Java applications don't automatically respect HTTP_PROXY/HTTPS_PROXY environment variables.
// Use JAVA_TOOL_OPTIONS to configure Java proxy settings for Maven, Gradle, and other Java tools.
// This environment variable is automatically picked up by all JVMs.
JAVA_TOOL_OPTIONS: `-Dhttp.proxyHost=${networkConfig.squidIp} -Dhttp.proxyPort=${SQUID_PORT} -Dhttps.proxyHost=${networkConfig.squidIp} -Dhttps.proxyPort=${SQUID_PORT}`,
SQUID_PROXY_HOST: 'squid-proxy',
SQUID_PROXY_PORT: SQUID_PORT.toString(),
Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

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

This unconditionally sets JAVA_TOOL_OPTIONS, which can unintentionally drop user-provided JVM flags when running with --env-all (since the later env pass-through won’t override existing keys). Consider merging with an existing host value (append your proxy flags to process.env.JAVA_TOOL_OPTIONS when present), while still allowing config.additionalEnv.JAVA_TOOL_OPTIONS to override.

Suggested change
const environment: Record<string, string> = {
HTTP_PROXY: `http://${networkConfig.squidIp}:${SQUID_PORT}`,
HTTPS_PROXY: `http://${networkConfig.squidIp}:${SQUID_PORT}`,
// Java applications don't automatically respect HTTP_PROXY/HTTPS_PROXY environment variables.
// Use JAVA_TOOL_OPTIONS to configure Java proxy settings for Maven, Gradle, and other Java tools.
// This environment variable is automatically picked up by all JVMs.
JAVA_TOOL_OPTIONS: `-Dhttp.proxyHost=${networkConfig.squidIp} -Dhttp.proxyPort=${SQUID_PORT} -Dhttps.proxyHost=${networkConfig.squidIp} -Dhttps.proxyPort=${SQUID_PORT}`,
SQUID_PROXY_HOST: 'squid-proxy',
SQUID_PROXY_PORT: SQUID_PORT.toString(),
const baseJavaToolOptions = process.env.JAVA_TOOL_OPTIONS ? `${process.env.JAVA_TOOL_OPTIONS} ` : '';
const environment: Record<string, string> = {
HTTP_PROXY: `http://${networkConfig.squidIp}:${SQUID_PORT}`,
HTTPS_PROXY: `http://${networkConfig.squidIp}:${SQUID_PORT}`,
// Java applications don't automatically respect HTTP_PROXY/HTTPS_PROXY environment variables.
// Use JAVA_TOOL_OPTIONS to configure Java proxy settings for Maven, Gradle, and other Java tools.
// This environment variable is automatically picked up by all JVMs.
JAVA_TOOL_OPTIONS: `${baseJavaToolOptions}-Dhttp.proxyHost=${networkConfig.squidIp} -Dhttp.proxyPort=${SQUID_PORT} -Dhttps.proxyHost=${networkConfig.squidIp} -Dhttps.proxyPort=${SQUID_PORT}`,
SQUID_PROXY_HOST: 'squid-proxy',
SQUID_PROXY_PORT: SQUID_PROXY_PORT.toString(),

Copilot uses AI. Check for mistakes.
@Mossaka Mossaka closed this Feb 9, 2026
@Mossaka Mossaka reopened this Feb 9, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Feb 9, 2026

🎬 THE ENDSmoke Claude MISSION: ACCOMPLISHED! The hero saves the day! ✨

@github-actions
Copy link
Contributor

github-actions bot commented Feb 9, 2026

Chroot tests passed! Smoke Chroot - All security and functionality tests succeeded.

@Mossaka
Copy link
Collaborator

Mossaka commented Feb 9, 2026

@copilot do not have code this but add these to the smoke java workflow

@github-actions
Copy link
Contributor

github-actions bot commented Feb 9, 2026

📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤

@github-actions
Copy link
Contributor

github-actions bot commented Feb 9, 2026

✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟

@github-actions
Copy link
Contributor

github-actions bot commented Feb 9, 2026

Deno Build Test Results

Project Tests Status
oak 1/1 ✅ PASS
std 1/1 ✅ PASS

Overall: ✅ PASS

AI generated by Build Test Deno

@github-actions
Copy link
Contributor

github-actions bot commented Feb 9, 2026

Smoke Test Results (Claude)

Last 2 Merged PRs:

Test Results:

  • ✅ GitHub MCP (retrieved PR list)
  • ✅ Playwright (navigated to github.com, title verified)
  • ✅ File Write (created test file)
  • ✅ Bash Tool (verified file content)

Status: PASS

AI generated by Smoke Claude

@github-actions
Copy link
Contributor

github-actions bot commented Feb 9, 2026

Rust Build Test Results

Project Build Tests Status
fd 1/1 PASS
zoxide 1/1 PASS

Overall: PASS

All Rust projects built and tested successfully.

AI generated by Build Test Rust

@github-actions
Copy link
Contributor

Bun Build Test Results

Project Install Tests Status
elysia 1/1 PASS
hono 1/1 PASS

Overall: PASS

All Bun projects built and tested successfully.

AI generated by Build Test Bun

@github-actions
Copy link
Contributor

C++ Build Test Results

Project CMake Build Status
fmt PASS
json PASS

Overall: PASS

All C++ projects successfully configured with CMake and built without errors.

AI generated by Build Test C++

@github-actions
Copy link
Contributor

Go Build Test Results

Project Download Tests Status
color 1/1 PASS
env 1/1 PASS
uuid 1/1 PASS

Overall: PASS

All Go projects successfully downloaded dependencies and passed tests.

AI generated by Build Test Go

@github-actions
Copy link
Contributor

Deno Build Test Results

Project Tests Status
oak 1/1 ✅ PASS
std 1/1 ✅ PASS

Overall: ✅ PASS

All Deno tests completed successfully.

AI generated by Build Test Deno

@github-actions
Copy link
Contributor

Smoke Test: Claude Engine - PASS

Status: PASS

AI generated by Smoke Claude

@github-actions
Copy link
Contributor

Smoke Test Results

Last 2 Merged PRs:

Test Results:

  • ✅ GitHub MCP: Fetched last 2 merged PRs
  • ✅ Playwright: Verified GitHub page title
  • ✅ File Write: Created test file
  • ✅ Bash: Verified file contents

Overall Status: PASS

cc @Copilot @Mossaka

AI generated by Smoke Copilot

@github-actions
Copy link
Contributor

Node.js Build Test Results ✅

All projects tested successfully!

Project Install Tests Status
clsx PASS PASS
execa PASS PASS
p-limit PASS PASS

Overall: PASS

AI generated by Build Test Node.js

@github-actions
Copy link
Contributor

Java Build Test Results

✅ Java Proxy Configuration Status

JAVA_TOOL_OPTIONS:

-Dhttp.proxyHost=172.30.0.10 -Dhttp.proxyPort=3128 -Dhttps.proxyHost=172.30.0.10 -Dhttps.proxyPort=3128 -Dhttp.nonProxyHosts=localhost|127.0.0.1|host.docker.internal

Detected Proxy Properties:

  • http.proxyHost = 172.30.0.10
  • http.proxyPort = 3128
  • https.proxyHost = 172.30.0.10
  • https.proxyPort = 3128
  • http.nonProxyHosts = localhost|127.0.0.1|host.docker.internal

Build/Test Results

Project Compile Tests Status
gson 1/1 PASS
caffeine 1/1 PASS

Overall: ✅ PASS

All Java projects compiled successfully and all tests passed through the AWF firewall.

AI generated by Build Test Java

@github-actions
Copy link
Contributor

Chroot Version Comparison Test Results

Runtime Host Version Chroot Version Match?
Python Python 3.12.12 Python 3.12.3 ❌ NO
Node.js v24.13.0 v20.20.0 ❌ NO
Go go1.22.12 go1.22.12 ✅ YES

Overall Result: ❌ Tests Failed

The chroot environment successfully accessed host binaries, but version mismatches were detected for Python and Node.js. This may indicate the chroot is using container binaries instead of host binaries for these runtimes.

AI generated by Smoke Chroot

@github-actions
Copy link
Contributor

feat: add runtime configuration for one-shot token protection via AWF_ONE_SHOT_TOKENS
chore(deps): bump the github-actions group with 11 updates
GitHub MCP merged PR review ✅
safeinputs-gh PR list ✅
Playwright title check ✅
Tavily search ❌
File write + cat verify ✅
Discussion comment ✅
Build (npm ci && npm run build) ✅
Overall: FAIL

AI generated by Smoke Codex

Instead of adding JAVA_TOOL_OPTIONS and Maven settings.xml generation
to docker-manager.ts, instruct the agent to create ~/.m2/settings.xml
with proxy settings before running Maven commands. This is simpler and
doesn't require changes to the AWF core.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Contributor

github-actions bot commented Feb 10, 2026

Chroot tests passed! Smoke Chroot - All security and functionality tests succeeded.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 10, 2026

🎬 THE ENDSmoke Claude MISSION: ACCOMPLISHED! The hero saves the day! ✨

@github-actions
Copy link
Contributor

github-actions bot commented Feb 10, 2026

📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤

@github-actions
Copy link
Contributor

github-actions bot commented Feb 10, 2026

✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟

@github-actions
Copy link
Contributor

Build Test: Node.js - Results

Project Install Tests Status
clsx PASS PASS
execa PASS PASS
p-limit PASS PASS

Overall: PASS

All Node.js projects built and tested successfully.

AI generated by Build Test Node.js

@github-actions
Copy link
Contributor

Build Test: Rust - ❌ FAILED

Status: Cannot execute test - Rust toolchain not installed

Project Build Tests Status
fd - NOT RUN
zoxide - NOT RUN

Overall: FAILED

Error Details

The Rust toolchain (cargo, rustc) is not available in the GitHub Actions runner environment.

Required Action

Add Rust installation step to the workflow:

- name: Install Rust
  uses: actions-rs/toolchain@v1
  with:
    toolchain: stable
    profile: minimal

AI generated by Build Test Rust

@github-actions
Copy link
Contributor

Bun Build Test Results

Project Install Tests Status
elysia 1/1 PASS ✅
hono 1/1 PASS ✅

Overall: PASS ✅

All Bun projects built and tested successfully with Bun v1.3.9.

AI generated by Build Test Bun

@github-actions
Copy link
Contributor

Go Build Test Results

Project Download Tests Status
color 1/1 PASS
env 1/1 PASS
uuid 1/1 PASS

Overall: PASS

All Go projects built and tested successfully.

AI generated by Build Test Go

@github-actions
Copy link
Contributor

Deno Build Test Results

Project Tests Status
oak 1/1 ✅ PASS
std 1/1 ✅ PASS

Overall: ✅ PASS

All Deno tests completed successfully.

AI generated by Build Test Deno

@github-actions
Copy link
Contributor

C++ Build Test Results

Project CMake Build Status
fmt PASS
json PASS

Overall: PASS

All C++ projects built successfully.

AI generated by Build Test C++

@github-actions
Copy link
Contributor

Smoke Test: Claude Engine

Last 2 merged PRs:

✅ GitHub MCP
✅ Playwright (page title verified)
✅ File Writing
✅ Bash Tool

Overall: PASS

AI generated by Smoke Claude

@github-actions github-actions bot mentioned this pull request Feb 10, 2026
@github-actions
Copy link
Contributor

🧪 Smoke Test Results

Last 2 Merged PRs:

Test Results:

  • ✅ GitHub MCP: Retrieved last 2 merged PRs
  • ✅ Playwright: Verified GitHub page title contains "GitHub"
  • ✅ File Writing: Created /tmp/gh-aw/agent/smoke-test-copilot-21879411070.txt
  • ✅ Bash Tool: Verified file content successfully

Overall Status: PASS

cc @Mossaka

AI generated by Smoke Copilot

@github-actions
Copy link
Contributor

Recent merged PRs: feat: add build-test-dotnet workflow | feat: add skip-unset mode to one-shot token library with value preview (enabled by default)

  1. GitHub MCP last 2 merged PRs ✅
  2. safeinputs-gh pr list ✅
  3. Playwright title contains GitHub ✅
  4. Tavily search ❌ (missing MCP)
  5. File write ✅
  6. Bash cat verify ✅
  7. Discussion query + comment ✅
  8. npm ci && npm run build ✅
    Overall: FAIL

AI generated by Smoke Codex

@github-actions
Copy link
Contributor

Chroot Version Comparison Test Results

Runtime Host Version Chroot Version Match?
Python Python 3.12.12 Python 3.12.3 ❌ NO
Node.js v24.13.0 v20.20.0 ❌ NO
Go go1.22.12 go1.22.12 ✅ YES

Overall Result:Tests Failed

The chroot mode successfully accessed host binaries, but version mismatches were detected for Python and Node.js. Go matched exactly between host and chroot environments.

AI generated by Smoke Chroot

@Mossaka Mossaka merged commit e3bd89f into main Feb 10, 2026
90 of 91 checks passed
@Mossaka Mossaka deleted the copilot/fix-broken-pipeline branch February 10, 2026 20:48
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.

2 participants