Solved pkg command behind proxy

Hello,

I am trying to make pkg(8) work behind proxy on FreeBSD 11.

Added to /usr/local/etc/pkg.conf
Code:
pkg_env : {
    http_proxy: "{http://10.0.0.1:8080}"
    https_proxy: "{https://10.0.0.1:8080}
}

With no luck. Any suggestions? Thanks.
 
Remove the {}.

Code:
pkg_env : {
    http_proxy: "http://10.0.0.1:8080"
    https_proxy: "https://10.0.0.1:8080"
}
 
It seems HTTPS_PROXY isn't called even if VULNXML_SITE is set to a secure URL (rather HTTP_PROXY is consulted).

If you do use a HTTPS located VULNXML_SITE you may also need to specify a certificate path (assuming security/ca_root_nss is installed:

Code:
PKG_ENV {
        FTP_PROXY: proxy_hostname:proxy_port
        HTTP_PROXY: proxy_hostname:proxy_port
        HTTPS_PROXY: proxy_hostname:proxy_port
        SSL_CA_CERT_PATH /usr/local/share/certs
}

NB: I only needed HTTP_PROXY and SSL_CA_CERT_PATH for both VULNXML_SITE = "http://..." and VULNXML_SITE = "https://..."

I avoid pointing proxy variables at URLs as URLs refer to resources, not services on a host (although in this case it does work).
Edit: I guess URLs are useful when specifying authentication parameters.
 
Last edited:
Back
Top