title: Use ELPA (Emacs) behind a proxy requiring authentication
body: <p>I have read <a href="https://stackoverflow.com/questions/1595418/emacs-behind-http-proxy">this</a> and <a href="https://stackoverflow.com/questions/2783267/how-to-configure-emacs-behind-an-authenticated-http-proxy">this</a> question. In both they say Emacs can deal with authentication, but it does not work for me.</p>
  
  <p>The question is: What is wrong?</p>
  
  <p>The Emacs version is 24.0.97-1, and it is running on 64-bit Linux.</p>
  
  <p>At work I have to use proxy server for any Internet connection. So I set the following environment variables:</p>
  
  <pre><code>http_proxy="http://username:password@ip:port
  https_proxy="https://username:password@ip:port
  ftp_proxy="ftp://username:password@ip:port
  </code></pre>
  
  <p>This works. I can download packages without any problem.</p>
  
  <p>When I run <code>M-x package-refresh-contents</code> in Emacs it asks me for login and password for the proxy server, but it can not connect to the server. It even does not try to connect, i.e. after I type password and press <code>Enter</code> Emacs <strong>instantly</strong> reports:
  <code>Failed to download 'marmalade' archive</code></p>
  
  <p>The same happens if I remove username and password from <code>http_proxy</code> variable or if I set <code>url-proxy-services</code> in Emacs (even if I unset the system variable).</p>