Two traps in java.net.http.HttpClient that bite when you route it through a proxy, because neither one looks like a proxy problem at first.
Basic proxy auth is disabled for HTTPS tunnels by default, so your username and password can be perfectly right and the tunnel still fails on auth.
The nastier one: point it at a SOCKS proxy and it gets ignored, so requests leave from the machine's own address. No exception, no warning. Everything looks fine until you check the exit IP, and by then the job may have run for a week from your server.
So whatever client you use, I'd log the exit IP once at startup and fail the run if it matches the host's address. It's a few lines and it catches this whole family of mistakes.
Disclosure: we run a proxy service, this came out of comparing proxy support across languages.