In case anybody wonders:
The issue here, is that when sudoing, a newenvironment is loaded, meaning that http_proxy is no longer set.
To resolve this issue you can add Defaults env_keep += "http_proxy https_proxy" to your /etc/sudoers file in order to keep those variables when switching to the secure path.
Reference: https://help.ubuntu.com/community/EnvironmentVariables