If you want to execute curl commands on your local machine and connect to an HTTPS server that is only reachable from a bastion or other host through which you can only get to via SSH, the following is how you set up the SSH tunnel and execute the curl command.
The following will not work
# Create ssh tunnel
#
ssh -L localhost:8443:example.com:443 user@bastion.example.com
# Attempt to hit the endpoint otherwise accessible from bastion.example.com
# with curl -X GET
→ Continue reading “curl HTTPS Over an SSH Tunnel”