Skip to content

Commit c1ea842

Browse files
committed
fix(ci): test vp TLS failure without ca-certificates on Alpine
The negative test now removes /etc/ssl/certs/ca-certificates.crt after vp is installed, then verifies that vp HTTPS calls fail. This proves rustls-platform-verifier requires OS root CAs. The previous approach (skipping ca-certificates in apk add) didn't work because curl transitively pulls in ca-certificates-bundle.
1 parent 08959d1 commit c1ea842

1 file changed

Lines changed: 11 additions & 15 deletions

File tree

.github/workflows/test-standalone-install.yml

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -221,21 +221,6 @@ jobs:
221221
steps:
222222
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
223223

224-
- name: Verify install.sh fails without ca-certificates
225-
run: |
226-
docker run --rm \
227-
-v "${{ github.workspace }}:/workspace" \
228-
-e VITE_PLUS_VERSION=alpha \
229-
-e CI=true \
230-
alpine:3.21 sh -c "
231-
apk add --no-cache bash curl libstdc++
232-
if cat /workspace/packages/cli/install.sh | bash 2>&1; then
233-
echo 'Error: install.sh should fail without ca-certificates'
234-
exit 1
235-
fi
236-
echo 'Confirmed: install.sh fails without ca-certificates (expected)'
237-
"
238-
239224
- name: Run install.sh in Alpine container
240225
run: |
241226
docker run --rm \
@@ -269,6 +254,17 @@ jobs:
269254
vp env doctor
270255
vp env run --node 24 -- node -p \"process.versions\"
271256
257+
# Verify vp requires ca-certificates for TLS (rustls-platform-verifier reads OS cert store).
258+
# Remove the cert bundle, then try to download a Node.js version not yet cached.
259+
rm -f /etc/ssl/certs/ca-certificates.crt
260+
if vp env run --node 23 -- node -e 'process.exit(0)' 2>&1; then
261+
echo 'Error: vp should fail without ca-certificates'
262+
exit 1
263+
fi
264+
echo 'Confirmed: vp HTTPS fails without ca-certificates (expected)'
265+
# Restore certs for remaining tests
266+
apk fix --no-cache ca-certificates-bundle
267+
272268
# Test create command
273269
vp create vite --no-interactive --no-agent -- hello --no-interactive -t vanilla
274270
cd hello && vp run build && vp --version

0 commit comments

Comments
 (0)