Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tails v4.12 (tor network) error curl: (7) Failed to connect to example.org port 443: Connection refused & curl --socks5 127.0.0.1:9050 #17

Closed
fititnt opened this issue Oct 24, 2020 · 2 comments

Comments

@fititnt
Copy link
Owner

fititnt commented Oct 24, 2020

See also:


The generic error happens when using Tails v4.12 after a simple curl to an HTTPS site (curl: (7) Failed to connect to example.org port 443: Connection refused).

amnesia@amnesia:~/Persistent/git/fititnt/TailsOS-for-non-whistleblowers$ curl https://beta.rclone.org/version.txt
curl: (7) Failed to connect to beta.rclone.org port 443: Connection refused
amnesia@amnesia:~/Persistent/git/fititnt/TailsOS-for-non-whistleblowers$ curl --socks5 127.0.0.1:9050 https://beta.rclone.org/version.txt
rclone v1.54.0-beta.4833.5164c3d2d

Adding --socks5 127.0.0.1:9050 fix this. But very likely this would break several shell scripts that relly on curl and do not have hardcoded proxy configuration or something

@fititnt
Copy link
Owner Author

fititnt commented Oct 24, 2020

--preproxy could also be used instead of --socks5. curl actually seems to support several proxies. Since is in theory the perso using curl already interested to do some direct proxy, I think if we have to setup some default, maybe se use --preproxy

https://curl.haxx.se/docs/manpage.html#--socks5

--socks5 <host[:port]>

Use the specified SOCKS5 proxy - but resolve the host name locally. If the port number is not specified, it is assumed at port 1080.

This option overrides any previous use of -x, --proxy, as they are mutually exclusive.

Since 7.21.7, this option is superfluous since you can specify a socks5 proxy with -x, --proxy using a socks5:// protocol prefix.

Since 7.52.0, --preproxy can be used to specify a SOCKS proxy at the same time -x, --proxy is used with an HTTP/HTTPS proxy. In such a case curl first connects to the SOCKS proxy and then connects (through SOCKS) to the HTTP or HTTPS proxy.

If this option is used several times, the last one will be used.

This option (as well as --socks4) does not work with IPV6, FTPS or LDAP.

Added in 7.18.0.

amnesia@amnesia:~$ curl --preproxy 127.0.0.1:9050 https://beta.rclone.org/version.txt
rclone v1.54.0-beta.4833.5164c3d2d

@fititnt
Copy link
Owner Author

fititnt commented Oct 24, 2020

It works! Example dotfile dotfiles/example/rocha/.curlrc will be commited later

amnesia@amnesia:~$ cat ~/.curlrc
# @see https://curl.haxx.se/docs/manpage.html

# "Tails v4.12 (tor network) error 'curl: (7) Failed to connect to example.org port 443: Connection refused' & 'curl --socks5 127.0.0.1:9050' #17"
preproxy = 127.0.0.1:9050
amnesia@amnesia:~$ curl https://beta.rclone.org/version.txt
rclone v1.54.0-beta.4833.5164c3d2d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant