[FreeBSD] Using portsnap With Basic Proxy Authentication

portsnap is one of the most interesting tools of FreeBSD dealing with the ports collection. portsnap, developed by Colin Percival, the current FreeBSD Security Officer, allows you to initially fetch a ports tree for your system and keep it updated. For those who don't need CVS logs or don't want to deal with cvsup and the other ports/src tree fetching methods, portsnap is an ideal solution that connects to web servers for its operation and has an extremely simple syntax that is very clearly outlined in the manpage.

However, you may need to use portsnap through a proxy that requires basic authentication. To do this, you have to define two environment variables: HTTP_PROXY and HTTP_PROXY_AUTH.


$ echo $SHELL
/usr/local/bin/zsh
$ sudo export HTTP_PROXY=http://proxyip:proxyport/
$ sudo export HTTP_PROXY_AUTH=basic:*:username:password


Some readers might be used to the more "traditional" way of specifying authentication credentials right into HTTP_PROXY:

$ sudo export HTTP_PROXY=http://username:password@proxyip:proxyport/


Sadly, this doesn't work with portsnap even though it is valid according to fetch(3).
|