dss
dss5mo ago

"invalid HTTP version parsed" error in proxy environmnet

Hi, now I installed deno on Ubuntu 22.04 and run deno upgrade then following error was happened. Could you let me know workaround if possible?
$ deno upgrade
Looking up latest version
error: client error (SendRequest)

Caused by:
invalid HTTP version parsed
$ deno upgrade
Looking up latest version
error: client error (SendRequest)

Caused by:
invalid HTTP version parsed
My PC is in proxy environment and the setting is: (.bashrc)
export HTTP_PROXY="http://xxxxxxxxxx.xxx"
export HTTPS_PROXY="http://xxxxxxxxxx.xxx"
export HTTP_PROXY="http://xxxxxxxxxx.xxx"
export HTTPS_PROXY="http://xxxxxxxxxx.xxx"
So HTTP_PROXY and HTTPS_PROXY is same value. Note: Other commands (ex. Git clone or apt or curl) was passed this configuration. And I tried to change http to https of HTTPS_PROXY as following:
export HTTPS_PROXY="https://xxxxxxxxxx.xxx"
export HTTPS_PROXY="https://xxxxxxxxxx.xxx"
Then the following error caused:
$ deno upgrade
Looking up latest version
error: client error (Connect)

Caused by:
Connection reset by peer (os error 104)
$ deno upgrade
Looking up latest version
error: client error (Connect)

Caused by:
Connection reset by peer (os error 104)
Deno version is:
$ deno --version
deno 1.45.3 (release, x86_64-unknown-linux-gnu)
v8 12.7.224.13
typescript 5.5.2
$ deno --version
deno 1.45.3 (release, x86_64-unknown-linux-gnu)
v8 12.7.224.13
typescript 5.5.2
3 Replies
Deno AI Helper
Deno AI Helper5mo ago
I wasn't able to find the answer to your question in the official Deno documentation. However, based on the information you've provided, there are a couple of things to consider: 1. The error "invalid HTTP version parsed" suggests that there might be an issue with the HTTP version used by the proxy or the way Deno is interpreting it. Since you mentioned that other commands like Git, apt, or curl are working fine with the proxy settings, this might be specific to how Deno handles proxy environments. 2. Changing the HTTPS_PROXY from http to https and then encountering a "Connection reset by peer" error could indicate that the proxy server is not accepting HTTPS connections for some reason, or there is a network issue between your PC and the proxy. Please note that this advice is not based on the Deno documentation, and I would advise you to double-check the accuracy of the advice given. It might be helpful to ensure that your proxy server supports HTTPS connections if you're setting HTTPS_PROXY to an https URL. Additionally, you could check if there are any specific proxy settings or environment variables that Deno requires in a proxy environment that might differ from other tools. If the issue persists, you may want to reach out to the Deno community or maintainers for more specific guidance, as they might have encountered similar issues in proxy environments.
dss
dssOP5mo ago
In my understanding,
https_proxy=http://xxxxx.xx:yyy # Setting case1
https_proxy=https://xxxxx.xx:yyy # Setting case2
https_proxy=http://xxxxx.xx:yyy # Setting case1
https_proxy=https://xxxxx.xx:yyy # Setting case2
The both configurations send CONNECT method to proxy server, and proxy server will establish TLS connection with the target server. But in case1, client does not establish TLS connection with proxy server and in case2, client establishes TLS connection. I guess deno does not support case1 setting, only supports case2 setting. Is It correct? Now, I found this PR in deno repository and after downgrade version to 1.45.2, deno was worked in proxy env!
dss
dssOP5mo ago
GitHub
fix(ext/fetch): use correct ALPN to proxies by seanmonstar · Pull R...
Sending ALPN to a proxy, and then when tunneling, requires better juggling of TLS configs. This improves the choice of TLS config in the proxy connector, based on what reqwest does. It also include...