I tried to use list-packages from behind a proxy which requires authentication. I was prompted for my user name and password for the proxy, and after entering it, the package list download failed. Trying again, I was prompted for the password again, and the failure repeated. Applying the patch below, I am only prompted the first time for my password, and the second and subsequent attempts do not fail. I am not very familiar with the url package, so I am not sure this is the correct fix for the issue of cached proxy passwords not being used. But before the patch I saw multiple identical copies of my username/password for the proxy stored in url-http-proxy-basic-auth-storage, while after the patch only one copy is stored, and subsequent attempts do not prompt for the password, so it seems correct. There is still a bug occuring on the first attempt though. It seems that two buffers are created on that attempt - one containing the 407 response requesting proxy authentication, and another containing the subsequent response from the target server after the proxy credentials have been supplied. The buffer returned to the package code is the first one, but it needs the second. I'm not sure whether this is a bug in url, or in the way package.el uses it, and edebug seemed to have problems with parts of the url package, so I could not investigate in detail.