After half hour of testing every potential combination of what I did, the following is necessary and sufficient for the thing to work:
Check that run(curl ...)
works. Then in Julia:
ENV["http_proxy"] = "http://<your_proxy>:<port>"
ENV["https_proy"] = "http://<your_proxy>:<port>"
ENV["JULIA_SSL_NO_VERIFY_HOSTS"] = "github.com"
And now it works correctly.
These commands might go to .julia/config/startup.jl
for convenience.