fix(warp): give replacing CA env vars the system roots too - #247
Merged
Conversation
SSL_CERT_FILE, CURL_CA_BUNDLE and REQUESTS_CA_BUNDLE replace the trust
store rather than extend it. Pointing them at warp-ca.pem (1 cert) left
every non-pxpipe HTTPS client in the warped session without the public
roots, so gcloud, gws, pip etc. failed certificate verification.
Before:
REQUESTS_CA_BUNDLE=~/.pxpipe/warp-ca.pem python -c 'requests.get("https://oauth2.googleapis.com/token")'
SSLError: CERTIFICATE_VERIFY_FAILED
After:
REQUESTS_CA_BUNDLE=~/.pxpipe/warp-ca-bundle.pem ...
404 (TLS verified)
warp now also writes warp-ca-bundle.pem = our CA + the OS root bundle
(/etc/ssl/cert.pem, ca-certificates.crt, ca-bundle.crt; an operator's own
SSL_CERT_FILE wins, and our own bundle is never nested on restart). The
three replacing vars get the bundle; NODE_EXTRA_CA_CERTS keeps the CA-only
file since Node appends. If no system bundle is found warp says so at
startup instead of failing silently.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SSL_CERT_FILE,CURL_CA_BUNDLEandREQUESTS_CA_BUNDLEreplace the trust store; onlyNODE_EXTRA_CA_CERTSappends. warp pointed all four atwarp-ca.pem(1 cert), so every non-pxpipe HTTPS client inside a warped session lost the public roots and failed verification (gcloud, gws, pip).Before:
After:
warp now writes
warp-ca-bundle.pem= our CA followed by the OS root bundle (/etc/ssl/cert.pem,ca-certificates.crt,ca-bundle.crt,ca-bundle.pem; an operator's ownSSL_CERT_FILEwins; our own bundle is never nested on restart). The three replacing vars get the bundle,NODE_EXTRA_CA_CERTSkeeps the CA-only file. If no system bundle exists warp says so at startup instead of silently breaking the child.Fixes #245
Verify
(macOS
curlis not a valid repro: Apple's build trusts the keychain regardless of--cacert. Pythonrequestsis, and matches the reporter's gcloud trace.)mainpnpm testandpnpm typecheckpass