fix: fix connection errors when using custom system certificates and an http proxy.#807
Open
zicklag wants to merge 1 commit intorailwayapp:masterfrom
Open
fix: fix connection errors when using custom system certificates and an http proxy.#807zicklag wants to merge 1 commit intorailwayapp:masterfrom
zicklag wants to merge 1 commit intorailwayapp:masterfrom
Conversation
…an http proxy. When trying to use the Railway CLI behind an HTTP proxy that requires a custom certificate ( such as some VPNs ), the CLI would previously fail with a certificate error. This adds the `rustls-tls-native-roots` feature reqwest to trust the native platform's system certificate store to fix that. Railway commands that require a websocket connection were also failing to go through the proxy, because while `reqwest` automatically sends requests through the proxy `async-tungstenite` would not. This removes `async-tungstenite` in favor of `reqwest-websocket` which is simpler and uses `reqwest` to properly send the initial HTTP request through the proxy before the websocket upgrade.
Collaborator
|
Could we ask for your initial confirmation that these changes have not modified any existing behavior, and for how you reached that conclusion? |
Author
|
I tried to make sure the new code didn't change any behavior. I tested the CLI locally where I have an http proxy with a custom certificate, and I also tested on a cloud server which has no proxy. On both of them I was able to use several railway commands to connect to my environment including Everything worked as expected. All the code is hand-written without AI assistance if that makes any difference. :) I also ran the tests, all of which are passing. There is a clippy warning, but that was already there before this PR. |
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.
When trying to use the Railway CLI behind an HTTP proxy that requires a custom certificate ( such as some VPNs ), the CLI would previously fail with a certificate error. This adds the
rustls-tls-native-rootsfeature reqwest to trust the native platform's system certificate store to fix that.Railway commands that require a websocket connection were also failing to go through the proxy, because while
reqwestautomatically sends requests through the proxyasync-tungstenitewould not. This removesasync-tungstenitein favor ofreqwest-websocketwhich is simpler and usesreqwestto properly send the initial HTTP request through the proxy before the websocket upgrade.