torsocks fails to set socks5h proxy for curl, git, ... - Not resolving .onion address (RFC 7686)
this fails: wrapping curl and git with torsocks 2.4.0 (305e42c6)
$ torsocks curl http://gg6zxtreajiijztyy5g6bt5o6l3qu32nrg7eulyemlhxwwl6enk6ghad.onion
curl: (6) Not resolving .onion address (RFC 7686)
$ torsocks git clone --depth=1 http://gg6zxtreajiijztyy5g6bt5o6l3qu32nrg7eulyemlhxwwl6enk6ghad.onion/milahu/alchi
Cloning into 'alchi'...
fatal: unable to access 'http://gg6zxtreajiijztyy5g6bt5o6l3qu32nrg7eulyemlhxwwl6enk6ghad.onion/milahu/alchi/': Not resolving .onion address (RFC 7686)
this works: passing tor's socks5h proxy to curl and git directly with a proxy argument
$ curl --proxy socks5h://127.0.0.1:9050 http://gg6zxtreajiijztyy5g6bt5o6l3qu32nrg7eulyemlhxwwl6enk6ghad.onion
$ git -c remote.origin.proxy=socks5h://127.0.0.1:9050 clone --depth=1 http://gg6zxtreajiijztyy5g6bt5o6l3qu32nrg7eulyemlhxwwl6enk6ghad.onion/milahu/alchi
$ cd alchi
$ git config --add remote.origin.proxy socks5h://127.0.0.1:9050
$ git pull
related issues:
- torspec#202 - Formalize toggle override for non-Tor applications that follow RFC 7686
-
https://github.com/curl/curl/discussions/11125 - I want to resolve onion addresses
- https://github.com/curl/curl/pull/11236 - hostip: add CURL_ALLOW_DOT_ONION to allow .onion lookups
- git is based on libcurl