How to git clone with SSH through boringproxy

I have Gitea running in a docker container on my client with SSH on port 222 and the UI on port 3000; I’ve successfully done the following:

  • Created a tunnel from the server/proxy to the client port 3000, so I have access to Gitea’s UI
  • I can clone repositories via HTTPS, since they’re using the same tunnel
  • I created a tunnel to allow SSH-ing to the client (using the solution from here)
  • I can clone repositories with SSH if I’m on the same network and specify the local IP address as the domain

I can’t seem to create a tunnel that allows for cloning repositories via ssh. I’ve tried both the “default” tunnel configuration (client HTTPS) and the one which worked for SSH-ing into the machine (server HTTPS with external TCP like the SSH), but neither gives me access; I get a “connection refused” error. Has anyone managed to clone repositories using SSH through boringproxy? With Gitea or any other git server.

My first guess would be that the problem here is not using the default port 22. Have you tried telling git to use the tunnel port?

Sorry for the late reply, I’ve tried both with the port Gitea has opened for SSH (222), as well as the port on the server running boringproxy, and both return the error:

ssh: connect to host subdomain.domain.com port 222 (or boringproxy port): Connection refused
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

I mainly access my repos from my local network, so using the local IP of my gitea instance isn’t too inconvenient for me. I’ll write back here if I stumble on to something that works though. Thanks for the lead!

No worries. Feel free to post again if you want to pursue debugging.