Articles
Software
Gallery
Other works
Contacts

#Fixing Git address-resolving issues of Hidden (Onion) Services.html



                {@begin=sh@
                    $ [proxychains|torify] git clone http://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.onion/anon/test.git
                    Cloning into 'test'...
                    fatal: unable to access 'http://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.onion/anon/test.git/': Not resolving .onion address (RFC 7686)
                @end=sh@}
                >no clue why proxychains actually fails
                >the error doesnt even have a mark in the source code, not sure what throws it
                >not understanding the issue does not prevent us from solving it
                1. Configure git to consult a proxy for onion addresses
                    >open your ".gitconfig" (presumably under "~/")
                    -append:
                    {
                        # assuming the service is http, not https; you could add both by duplicating,
                        # however git with self-signed https certs is its own can of worms
                        [http "http://*.onion"]
                            sslVerify = false
                            proxy = "socks5h://127.0.0.1:9050"
                    }
                2. Ensure Tor provides a SOCKS5 proxy at the configured port (9050 in our case)
                    >open your torrc (presumably under "/etc/tor/torrc")
                    -ensure you have the following line:
                    {
                        SOCKSPort 9050
                    }
                3. Enjoy
                    >from now on .onion urls will work for you like regular ones
                    {
                        $ git clone http://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.onion/anon/test.git
                        Cloning into 'test'...
                        remote: Enumerating objects: 112, done.
                        remote: Counting objects: 100% (112/112), done.
                        remote: Compressing objects: 100% (80/80), done.
                        remote: Total 112 (delta 21), reused 89 (delta 17), pack-reused 0
                        Receiving objects: 100% (112/112), 128.80 KiB | 241.00 KiB/s, done.
                        Resolving deltas: 100% (21/21), done.
                    }