Skip to content

fix(common): verify HTTPS certificate identity - #3307

Merged
imbajin merged 2 commits into
apache:masterfrom
hugegraph:fix/integration-tls-verification
Oct 10, 2026
Merged

imbajin merged 2 commits into
apache:masterfrom
hugegraph:fix/integration-tls-verification

Conversation

@imbajin

@imbajin imbajin commented Oct 10, 2026

Copy link
Copy Markdown
Member

Purpose

A custom truststore previously allowed a trusted certificate with the wrong server identity. HTTPS requests now retain OkHttp's default hostname verification: trust alone is insufficient, and a matching DNS or IP Subject Alternative Name is required. The public HostNameVerifier(String) constructor remains available.

HTTPS certificate identity: before and after

Main changes

  • Preserve certificate identity checks when configuring a custom truststore.
  • Cover real HTTPS handshakes for matching DNS/IP SANs, wrong or missing SANs, and untrusted certificates.
  • Clarify shared-type and query-serializer import migrations, process-wide namespace constraints, and which distribution outputs clean removes.

Verification

Fresh Java 17 compilation, targeted REST tests, style checks and independent reviews pass. The same handshake regression fails with the original verifier because the trusted, wrong-identity certificate is accepted.

Documentation

The Commons README documents the certificate requirement; the migration and contribution guides contain the accompanying corrections. Paired website documentation: apache/hugegraph-doc#511.

- retain native OkHttp certificate hostname checks
- preserve the public verifier signature and delegation
- cover real HTTPS identity and trust failures
- document matching DNS and IP SAN requirements
@codecov

codecov Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 41.93%. Comparing base (6df8dd9) to head (09f067a).

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #3307      +/-   ##
============================================
+ Coverage     41.71%   41.93%   +0.22%     
- Complexity     7036     7105      +69     
============================================
  Files           762      770       +8     
  Lines         67057    67320     +263     
  Branches       9021     9042      +21     
============================================
+ Hits          27974    28234     +260     
+ Misses        35872    35870       -2     
- Partials       3211     3216       +5     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

- Distinguish relocated shared types from core helpers
- Document process namespace binding and conflicts
- Clarify current distribution and archive cleanup
@imbajin
imbajin merged commit 87a06a9 into apache:master Oct 10, 2026
34 checks passed
@imbajin
imbajin deleted the fix/integration-tls-verification branch October 10, 2026 11:18
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