Repository navigation
fix(vcs): verify TLS for Git provider API calls by default - #14802
Conversation
Provider API requests skipped certificate verification for every adapter. Verification is now on by default; self-hosted Gitea and GitLab installs behind a private CA can opt out with _APP_VCS_GITEA_SELF_SIGNED or _APP_VCS_GITLAB_SELF_SIGNED.
|
Review complete. 🟠 1 high 📍 Findings outside the diff (1) — 🟠 1 high — defects on lines GitHub can't attach comments to🟠 High — Git clone/push shell commands ignore // packages/vcs/src/Adapter/Git.php
322 protected function cloneCommand(string $cloneUrl, string $version, string $versionType, string $directory, string $rootDirectory): Command
323 {
324 $rootDirectory = $this->normalizeRepositoryPath($rootDirectory);
325 if ($rootDirectory === '') {
326 $rootDirectory = '*';
327 }
328
329 // A leading dash would reach git as an option instead of a ref; a tag
330 // travels as refs/tags/<name>, so any name is safe there
331 if ($versionType !== self::CLONE_TYPE_TAG && str_starts_with($version, '-')) {
332 throw new InvalidArgumentException("Invalid clone version: {$version}");
333 }The new The change introduces an opt-in for self-signed TLS certificates on self-hosted Gitea/GitLab providers: two new env variables wired through
Reviewed commit: ec8e649 |
New ConsoleProject ID: Tip Teams feature lets you group users with membership management and role permissions |
🟢 Tier S · Ready to merge
The VCS adapter now verifies TLS certificates by default, with an explicit setter for consumers who need to disable verification. Tests cover the default and opt-in state across adapter classes and Appwrite’s registered providers.
📂 Walkthrough · 3
Reviewed |
✨ Benchmark resultsComparing
Per-scenario breakdown & investigation detailsMetrics below reflect the current branch (after). Δ P95 compares against the base.
Top API waits (after)
|
commit: |
Security rulesNo new WARNING or ERROR findings from security rules. 6 existing findings tracked in
|
OAuth2 token exchange and git clone/push already verified certificates, so a self-signed host never worked end to end and the opt-in only covered one of three paths. Verify everywhere instead of extending the opt-out.
|
Good catch, thanks. OAuth2 token exchange and |
|
@hansi-codes review |
fix(vcs): verify TLS for Git provider API calls by default (cherry picked from commit e5d66e2)
utopia-php/vcs 4.x accepts self-signed certificates on every provider API call by default.

Summary
Git provider adapters disabled TLS certificate verification for every API request. The adapter now verifies certificates by default, so GitHub, GitLab, Gitea, Bitbucket, Origin and Entire API calls all check the server certificate, matching what OAuth2 token exchange and
gitclone/push already did.packages/vcs:selfSigneddefaults tofalse; addssetSelfSigned()/isSelfSigned()next to the existing setters so library consumers can opt out explicitly.gitclone/push have always verified certificates, so a self-signed Gitea or GitLab host never worked end to end; an opt-out for API calls alone would not change that.Test plan
packages/vcs/tests/AdapterTest.php: every adapter verifies by default and only accepts self-signed certificates aftersetSelfSigned(true)(fails on the old default)tests/unit/Vcs/FactoryTest.php: every registered provider built by the factory verifies by defaultbin/monorepo check vcs(Pint, PHPStan, Rector) and the vcs unit tierRelated: appwrite-labs/cloud#6666