The ntpd script supports ntpd_env option (and ntpd_env_file in 12.0-STABLE). But ntpd_fetch_leapfile() subroutine doesn't support ntpd_env option.
So it's impossible to fetch the leapfile via a proxy (HTTP_PROXY variable for the fetch).
(In reply to Boris Korzun from comment #0)
Were you ever able to fix this "nicely"?
We have a couple of FreeBSD 12.1 hosts that rely on a proxy for their internet access. They suffer from this issue as well.
The workaround mentioned in https://forums.freebsd.org/threads/set-proxy-server-for-rc-d-periodic-scripts.69664/post-418020 was a good starting point, but unfortunately I was not able to get 'ntpd_env' working.
There is however 'ntpd_env_file' (at least in 12) to source external files, which works perfectly:
Just make sure that the referenced file is readable, and usable by sh(1).
Would prefer a more generic way though, instead of changing the environment for every service needing external access.
(In reply to Peter Pramberger from comment #2)
Sorry, I missed that 'ntpd_env_file' was already mentioned - for me it works that way.