When you are talking about command line programs, most of them respect https_server environment. You can do the following:
- Open
.bashrc in your home directory (In case you're using another shell, you should open their rc file.)
- Enter the line
export https_server=https://SERVERADDR:PORT where SERVERADDR is the IP address or hostname of your proxy server and PORT is the port.
- Save the file and type
source $HOME/.bashrc. This loads your changes into the current shell.
Now you are able to use the environment variable and every request goes through the HTTPS server.
There might some cases where he environment variable not works. Here you should use iptables to redirect your requests.