Skip to content

fix(maven-proxy): verify upstream chains with more than one intermediate CA - #49

Merged
azlekov merged 1 commit into
mainfrom
fix/maven-proxy-ssl-verify-depth
Nov 26, 2026
Merged

azlekov merged 1 commit into
mainfrom
fix/maven-proxy-ssl-verify-depth

Conversation

@azlekov

@azlekov azlekov commented Nov 26, 2026

Copy link
Copy Markdown

After #47 was rolled out to all four hosts, every Maven Central download through maven-proxy failed with 502. The nginx error was upstream SSL certificate verify error: (20:unable to get local issuer certificate). Google Maven and the Gradle Plugin Portal still worked.

Cause

nginx's proxy_ssl_verify_depth defaults to 1, which allows one CA between the leaf and a trusted root. Maven Central's chain needs more: leaf → YE1 → Let's Encrypt Root YE → ISRG Root X2 → ISRG Root X1. Alpine's CA bundle does not trust Root YE, so the chain has to reach ISRG Root X2 or X1.

Fix

  • Set proxy_ssl_verify_depth 4. Against the real upstreams, the old template returns 502 200 200 (Maven Central, Google, Plugin Portal) and the new one returns 200 200 200.
  • Add the regression test that should have caught this. The fake upstream in tests/maven-proxy.sh spoke plain HTTP, so no certificate chain was ever verified. It now serves HTTPS with a chain through two intermediate CAs, and the proxy trusts only the test root. The test fails with 502 without the fix and passes with it.

Already applied

The same template change is already live on beelink, hetzner-cx43, hetzner-cpx31 and rpi5. Only maven-proxy was restarted, and all three upstreams answer 200 from inside a runner. The outage lasted about 10 minutes (07:52 to about 08:02 UTC). No Gradle build ran in that window.

🤖 Generated with Claude Code

…ate CA

nginx's proxy_ssl_verify_depth defaults to 1: one CA between the leaf and a trusted root. Maven Central's chain runs through Let's Encrypt's
Root YE, which Alpine's bundle does not trust, and on to ISRG Root X2 and X1, so every Maven Central download through the proxy failed 502
("unable to get local issuer certificate") after the rollout of #47. Google Maven and the Plugin Portal were unaffected.

The proxy test's fake upstream spoke plain HTTP, so it never verified a chain. It now serves HTTPS with two intermediate CAs and fails 502
without the fix.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@azlekov
azlekov enabled auto-merge (squash) November 26, 2026 08:02
@azlekov
azlekov merged commit f7b6e90 into main Nov 26, 2026
12 checks passed
@azlekov
azlekov deleted the fix/maven-proxy-ssl-verify-depth branch November 26, 2026 08:10
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.

1 participant