Index: src/org/openstreetmap/josm/data/Preferences.java
===================================================================
--- src/org/openstreetmap/josm/data/Preferences.java	(revision 1663)
+++ src/org/openstreetmap/josm/data/Preferences.java	(working copy)
@@ -550,10 +550,10 @@
             Properties sysProp = System.getProperties();
             sysProp.put("proxySet", "true");
             sysProp.put("http.proxyHost", get(ProxyPreferences.PROXY_HOST));
-            sysProp.put("proxyPort", get(ProxyPreferences.PROXY_PORT));
+            sysProp.put("http.proxyPort", get(ProxyPreferences.PROXY_PORT));
             if (!getBoolean(ProxyPreferences.PROXY_ANONYMOUS)) {
-                sysProp.put("proxyUser", get(ProxyPreferences.PROXY_USER));
-                sysProp.put("proxyPassword", get(ProxyPreferences.PROXY_PASS));
+                sysProp.put("http.proxyUser", get(ProxyPreferences.PROXY_USER));
+                sysProp.put("http.proxyPassword", get(ProxyPreferences.PROXY_PASS));
             }
             System.setProperties(sysProp);
         }
Index: src/org/openstreetmap/josm/io/MyHttpURLConnection.java
===================================================================
--- src/org/openstreetmap/josm/io/MyHttpURLConnection.java	(revision 1663)
+++ src/org/openstreetmap/josm/io/MyHttpURLConnection.java	(working copy)
@@ -4,11 +4,36 @@
 import java.io.*;
 import java.net.URL;
 import java.net.Proxy;
+import java.nio.ByteBuffer;
+import java.nio.CharBuffer;
+import java.nio.charset.CharacterCodingException;
+import java.nio.charset.Charset;
+import java.nio.charset.CharsetEncoder;
 
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.gui.preferences.ProxyPreferences;
+import org.openstreetmap.josm.tools.Base64;
+
 public class MyHttpURLConnection extends sun.net.www.protocol.http.HttpURLConnection {
-            protected MyHttpURLConnection(URL u, Proxy p, sun.net.www.protocol.http.Handler handler)
+    
+    private void addProxyAuth() throws CharacterCodingException
+    {
+        if (Main.pref.getBoolean(ProxyPreferences.PROXY_ENABLE)) {
+            CharsetEncoder encoder = Charset.forName("UTF-8").newEncoder();
+            String auth = Main.pref.get(ProxyPreferences.PROXY_USER) + ":" + Main.pref.get(ProxyPreferences.PROXY_PASS);
+            ByteBuffer bytes = encoder.encode(CharBuffer.wrap(auth));
+            addRequestProperty("Proxy-Authorization", "Basic " + Base64.encode(bytes));
+        }
+    }
+            public MyHttpURLConnection(URL u, Proxy p, sun.net.www.protocol.http.Handler handler)
             {
               super(u,p,handler);
+              try {
+                addProxyAuth();
+              } catch (CharacterCodingException e) {
+                  System.err.println("Error adding proxy authentication");
+                  e.printStackTrace();
+              }
             }
 
 public synchronized OutputStream getOutputStream()
