fix(ohos): isolate platform paths and use rustls-only TLS - #583
fix(ohos): isolate platform paths and use rustls-only TLS#583FrankHan052176 wants to merge 4 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (8)
📝 WalkthroughWalkthroughThe change adds OpenHarmony-specific dependency selection and conditional compilation. OHOS uses Rustls platform verification, excludes Linux-only integrations, disables native-tls proxy and WebSocket paths, and skips native-tls TLS cache entries. ChangesOpenHarmony support
Estimated code review effort: 3 (Moderate) | ~25 minutes Mergeability Score: 🔵 Low · up to On OpenHarmony, the TLS verification export may rely on a backend that is unavailable, leaving the certificate-verification contract unclear; the PR is otherwise localized, but the owner should resolve or document this bounded risk before merging. Sequence Diagram(s)sequenceDiagram
participant Proxy
participant Rustls
participant NativeTls
Proxy->>Rustls: connect with Rustls
alt non-OHOS Rustls failure
Rustls-->>Proxy: connection error
Proxy->>NativeTls: fallback connection
else OHOS Rustls failure
Rustls-->>Proxy: connection error
Proxy-->>Proxy: log error and bail
end
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
This PR adds OpenHarmony-specific platform handling to
hbb_commonwhile keeping the existing behavior unchanged on Android, iOS, desktop Linux, macOS, and Windows.The fork maintains two deliberate branches:
ohos/rebaseis based on the latest upstreamhbb_common/mainand replays the OHOS commits. This PR follows that branch and currently points to7785eb4.ohos/coreis the Core-consumption line. It is based on the hbb_common revision currently used by RustDesk Core (f124c0a5) and replays the same OHOS commits, currently atc264f97.The branches are not interchangeable:
ohos/rebasetracks upstream review, whileohos/corekeeps the exact dependency history required by the RustDesk Core integration until the upstream changes are merged.It contains two scoped commits:
Motivation
Rust OpenHarmony targets such as
aarch64-unknown-linux-ohosreport:target_os = "linux"target_env = "ohos"As a result, code guarded only by
target_os = "linux"incorrectly treats OpenHarmony as a desktop Linux environment.OpenHarmony applications do not provide the same desktop Linux environment, filesystem layout, X11/Wayland stack, machine identity sources, or native TLS implementation. This causes unavailable dependencies and platform helpers to be compiled and makes configuration and IPC paths unsuitable for an application sandbox.
Changes
Platform and configuration isolation
TLS handling
tokio-native-tlsfor OpenHarmony.tokio-tungsteniteandtungstenitefeatures on OpenHarmony.NativeTlson OpenHarmony.NativeTlspath is requested unexpectedly.Compatibility
All behavioral changes are guarded by
target_env = "ohos"or its inverse.This PR does not change:
Branch and dependency validation
ohos/rebase(7785eb4) is publicly fetchable and is the head of this PR.ohos/core(c264f97) is publicly fetchable for the RustDesk Core submodule.f124c0a5d49a4a13381902124b65364ff28fa541.Validation
git diff --check upstream/main..HEADRelated repository
The OpenHarmony client and integration work are maintained at:
https://github.com/FrankHan052176/rustdesk4ohos
Summary by CodeRabbit
New Features
Bug Fixes