Skip to content

starboard: Unify CA certificate lookup - #13068

Merged
jellefoks merged 1 commit into
youtube:mainfrom
hferreiro:ca-certs
Oct 2, 2026
Merged

jellefoks merged 1 commit into
youtube:mainfrom
hferreiro:ca-certs

Conversation

@hferreiro

Copy link
Copy Markdown
Collaborator

The CA certificates were located three different ways. net::TrustStoreInMemoryStarboard read DIR_EXE/ssl/certs, CrashpadConfigTest.VerifyUploadCert appended app/cobalt/content to the content directory, and, when given no content path, the loaders' crashpad handler tried both places. This only worked where the build happened to stage a copy for each, and VerifyUploadCert failed on AOSP, where none matched its path.

All three now read /ssl/certs, where is the reader's content directory: the one the Evergreen library is loaded with, or the executable's directory in a non-Evergreen build.

The dependencies on the certificates now sit with what reads them. In an Evergreen build, elf_loader_sandbox depends on copy_ssl_certificates, which stages them at the content root for runs through the generated runfile. Each Evergreen target stages them in app//content for loader_app and the AOSP apks. //net depends on copy_ssl_certificates only in a non-Evergreen build, monolithic or modular, where the content root is the executable's directory.

CrashpadConfigTest.VerifyUploadCert now passes on AOSP, so re-enable it.

Bug: 532068409

The CA certificates were located three different ways.
net::TrustStoreInMemoryStarboard read DIR_EXE/ssl/certs,
CrashpadConfigTest.VerifyUploadCert appended app/cobalt/content to the
content directory, and, when given no content path, the loaders'
crashpad handler tried both places. This only worked where the build
happened to stage a copy for each, and VerifyUploadCert failed on AOSP,
where none matched its path.

All three now read <content>/ssl/certs, where <content> is the reader's
content directory: the one the Evergreen library is loaded with, or the
executable's directory in a non-Evergreen build.

The dependencies on the certificates now sit with what reads them. In an
Evergreen build, elf_loader_sandbox depends on copy_ssl_certificates,
which stages them at the content root for runs through the generated
runfile. Each Evergreen target stages them in app/<target>/content for
loader_app and the AOSP apks. //net depends on copy_ssl_certificates
only in a non-Evergreen build, monolithic or modular, where the content
root is the executable's directory.

CrashpadConfigTest.VerifyUploadCert now passes on AOSP, so re-enable it.

Bug: 532068409
@hferreiro
hferreiro requested a review from a team as a code owner October 2, 2026 12:22
@github-actions

github-actions Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor
Context State Description
CI / All Pass ✅ PASS All checks passed
CI / android ✅ PASS Passed
CI / evergreen ✅ PASS Passed
CI / linux ✅ PASS Passed
CI / tvos ✅ PASS Passed
@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

🤖 Gemini Suggested Commit Message


starboard: Unify CA certificate lookup

Consolidate the multiple ways CA certificates were located into a
unified mechanism. Previously, the network stack, Crashpad, and
loaders used different paths, leading to inconsistencies and test
failures on AOSP where paths did not match the staged locations.

All components now use starboard::GetCACertificatesPath(), which
resolves to the ssl/certs directory within the content root. Build
rules are updated to stage certificates at the appropriate relative
locations for both Evergreen and monolithic builds. This enables
re-enabling the VerifyUploadCert test on AOSP.

Bug: 532068409

💡 Pro Tips for a Better Commit Message:

  1. Influence the Result: Want to change the output? You can write custom prompts or instructions directly in the Pull Request description. The model uses that text to generate the message.
  2. Re-run the Generator: Post a comment with: /generate-commit-message

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request simplifies and refactors how trusted Certificate Authority (CA) root certificates are located and copied across Cobalt and Starboard. It consolidates the GetCACertificatesPath functions in starboard/common/paths.cc into a single function with a default argument, and updates various build targets and tests to use the simplified paths and copy targets. The review feedback suggests removing a redundant SB_LOG(ERROR) statement in GetCACertificatesPath to prevent false-positive error logs during unit tests where certificates are not staged.

Comment thread starboard/common/paths.cc Resolved
@jellefoks
jellefoks enabled auto-merge (squash) October 2, 2026 18:20
@jellefoks
jellefoks merged commit 5bdc602 into youtube:main Oct 2, 2026
685 of 689 checks passed
@hferreiro
hferreiro deleted the ca-certs branch October 2, 2026 21:33
@github-actions github-actions Bot added the cp-27.lts Cherry Pick to the 27.lts branch label Oct 2, 2026
@oxve oxve removed the cp-27.lts Cherry Pick to the 27.lts branch label Oct 5, 2026
briantting pushed a commit that referenced this pull request Oct 6, 2026
Refer to original PR: #13068

The CA certificates were located three different ways.
net::TrustStoreInMemoryStarboard read DIR_EXE/ssl/certs,
CrashpadConfigTest.VerifyUploadCert appended app/cobalt/content to the
content directory, and, when given no content path, the loaders'
crashpad handler tried both places. This only worked where the build
happened to stage a copy for each, and VerifyUploadCert failed on AOSP,
where none matched its path.

All three now read <content>/ssl/certs, where <content> is the reader's
content directory: the one the Evergreen library is loaded with, or the
executable's directory in a non-Evergreen build.

The dependencies on the certificates now sit with what reads them. In an
Evergreen build, elf_loader_sandbox depends on copy_ssl_certificates,
which stages them at the content root for runs through the generated
runfile. Each Evergreen target stages them in app/<target>/content for
loader_app and the AOSP apks. //net depends on copy_ssl_certificates
only in a non-Evergreen build, monolithic or modular, where the content
root is the executable's directory.

CrashpadConfigTest.VerifyUploadCert now passes on AOSP, so re-enable it.

Bug: 532068409

(cherry picked from commit 5bdc602)
briantting pushed a commit that referenced this pull request Oct 16, 2026
Refer to original PR: #13068

The CA certificates were located three different ways.
net::TrustStoreInMemoryStarboard read DIR_EXE/ssl/certs,
CrashpadConfigTest.VerifyUploadCert appended app/cobalt/content to the
content directory, and, when given no content path, the loaders'
crashpad handler tried both places. This only worked where the build
happened to stage a copy for each, and VerifyUploadCert failed on AOSP,
where none matched its path.

All three now read <content>/ssl/certs, where <content> is the reader's
content directory: the one the Evergreen library is loaded with, or the
executable's directory in a non-Evergreen build.

The dependencies on the certificates now sit with what reads them. In an
Evergreen build, elf_loader_sandbox depends on copy_ssl_certificates,
which stages them at the content root for runs through the generated
runfile. Each Evergreen target stages them in app/<target>/content for
loader_app and the AOSP apks. //net depends on copy_ssl_certificates
only in a non-Evergreen build, monolithic or modular, where the content
root is the executable's directory.

CrashpadConfigTest.VerifyUploadCert now passes on AOSP, so re-enable it.

Bug: 532068409

(cherry picked from commit 5bdc602)
briantting pushed a commit that referenced this pull request Oct 16, 2026
…kup (#13409)

Automated cherry-pick roll to 27.lts.

Original pull requests:
- #13068

CONFLICTED files:
```
cobalt/aosp/modular_apk.gni
cobalt/testing/filters/evergreen-arm-softfp-aosp/nplb_loader_filter.json
cobalt/testing/filters/evergreen-arm64-aosp/nplb_loader_filter.json
```

⚠️ This PR has conflicts that must be resolved manually (don't forget to
update the `.github/AUTOROLL` file). Use the following commands to
checkout the branch locally and resolve the conflicts in a separate
commit:

```bash
gh pr checkout <pull_request_number> -R youtube/cobalt

# Resolve conflicts and update .github/AUTOROLL then
git add <resolved_files>

# Copy CONFLICTED commit's message and metadata
# Replace CONFLICTED in title with RESOLVED
git commit -c <conflicted_sha>

git push origin autoroll-main-to-27.lts
```

---------

Co-authored-by: Henrique Ferreiro <hferreiro@igalia.com>
briantting pushed a commit that referenced this pull request Oct 16, 2026
Refer to original PR: #13068

The CA certificates were located three different ways.
net::TrustStoreInMemoryStarboard read DIR_EXE/ssl/certs,
CrashpadConfigTest.VerifyUploadCert appended app/cobalt/content to the
content directory, and, when given no content path, the loaders'
crashpad handler tried both places. This only worked where the build
happened to stage a copy for each, and VerifyUploadCert failed on AOSP,
where none matched its path.

All three now read <content>/ssl/certs, where <content> is the reader's
content directory: the one the Evergreen library is loaded with, or the
executable's directory in a non-Evergreen build.

The dependencies on the certificates now sit with what reads them. In an
Evergreen build, elf_loader_sandbox depends on copy_ssl_certificates,
which stages them at the content root for runs through the generated
runfile. Each Evergreen target stages them in app/<target>/content for
loader_app and the AOSP apks. //net depends on copy_ssl_certificates
only in a non-Evergreen build, monolithic or modular, where the content
root is the executable's directory.

CrashpadConfigTest.VerifyUploadCert now passes on AOSP, so re-enable it.

Bug: 532068409

(cherry picked from commit 5bdc602)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants