Index: src/main/java/hudson/ProxyConfiguration.java
===================================================================
--- src/main/java/hudson/ProxyConfiguration.java	(revision 19358)
+++ src/main/java/hudson/ProxyConfiguration.java	(working copy)
@@ -23,25 +23,34 @@
  */
 package hudson;
 
-import com.thoughtworks.xstream.XStream;
 import hudson.model.Hudson;
 import hudson.model.Saveable;
+import hudson.util.Scrambler;
 import hudson.util.XStream2;
-import hudson.util.Scrambler;
 
 import java.io.File;
 import java.io.IOException;
+import java.net.Authenticator;
 import java.net.InetSocketAddress;
+import java.net.PasswordAuthentication;
 import java.net.Proxy;
+import java.net.URL;
 import java.net.URLConnection;
-import java.net.URL;
 
+import com.thoughtworks.xstream.XStream;
+
 /**
  * HTTP proxy configuration.
  *
  * <p>
  * Use {@link #open(URL)} to open a connection with the proxy setting.
- *
+ * <p>
+ * Proxy authentication (including NTLM) is implemented by setting a default
+ * {@link Authenticator} which provides a {@link PasswordAuthentication}
+ * (as described in the Java 6 tech note 
+ * <a href="http://java.sun.com/javase/6/docs/technotes/guides/net/http-auth.html">
+ * Http Authentication</a>).
+ * 
  * @see Hudson#proxy
  */
 public final class ProxyConfiguration implements Saveable {
@@ -101,8 +110,15 @@
 
         URLConnection con = url.openConnection(p.createProxy());
         if(p.getUserName()!=null) {
-            con.setRequestProperty("Proxy-Authorization","Basic "+
-                    Scrambler.scramble(p.getUserName()+':'+p.getPassword()));
+
+        	// Add an authenticator which provides the credentials for proxy authentication
+            Authenticator.setDefault(new Authenticator() {
+                public PasswordAuthentication getPasswordAuthentication() {
+                    ProxyConfiguration p = Hudson.getInstance().proxy;
+                    return new PasswordAuthentication(p.getUserName(),
+                            p.getPassword().toCharArray());
+                }
+            });
         }
         return con;
     }