Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add proper support for Android's CA trust stores #120

Merged
merged 1 commit into from
Jan 14, 2025
Merged

Conversation

chenxiaolong
Copy link
Owner

golang does not support Android's various trust stores well. The CA certificates in /system/etc/security/cacerts are the only ones that are properly read. The updatable apex trust store in Android 14+ and the user trust store are ignored. System CA certificates that the user disables are still permitted to be used.

This commit implements our own certificate loading mechanism that loads from all of Android's trust stores and respects disabled certificates. We generate a combined PEM file in a temp file and feed that to rclone's CaCert option.

While live reloading is supported, the user experience is not that great. Due to rclone's caching, when certificates are reloaded, they only take effect in new remotes. The user will need to delete and recreate the remote, export and reimport, or force close RSAF.

Fixes: #119

golang does not support Android's various trust stores well. The CA
certificates in /system/etc/security/cacerts are the only ones that are
properly read. The updatable apex trust store in Android 14+ and the
user trust store are ignored. System CA certificates that the user
disables are still permitted to be used.

This commit implements our own certificate loading mechanism that loads
from all of Android's trust stores and respects disabled certificates.
We generate a combined PEM file in a temp file and feed that to rclone's
CaCert option.

While live reloading is supported, the user experience is not that
great. Due to rclone's caching, when certificates are reloaded, they
only take effect in new remotes. The user will need to delete and
recreate the remote, export and reimport, or force close RSAF.

Fixes: #119

Signed-off-by: Andrew Gunnerson <[email protected]>
@chenxiaolong chenxiaolong self-assigned this Jan 14, 2025
chenxiaolong added a commit that referenced this pull request Jan 14, 2025
Signed-off-by: Andrew Gunnerson <[email protected]>
@chenxiaolong chenxiaolong merged commit bff18e6 into master Jan 14, 2025
1 check passed
@chenxiaolong chenxiaolong deleted the ca-certs branch January 14, 2025 14:05
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.

功能请求:将 --no-check-certificate 添加为可选开关,以绕过证书验证
1 participant