From 2efe38b96b242e474e6be353c06ee0526bbbc198 Mon Sep 17 00:00:00 2001 From: magenoxx Date: Thu, 19 May 2011 13:56:53 +0400 Subject: [PATCH] Fixed proxy authentication: previous type wasn't discarded (so http didn't work). --- .../src/main/java/mage/client/remote/Session.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Mage.Client/src/main/java/mage/client/remote/Session.java b/Mage.Client/src/main/java/mage/client/remote/Session.java index f12d278d59..f8538142f4 100644 --- a/Mage.Client/src/main/java/mage/client/remote/Session.java +++ b/Mage.Client/src/main/java/mage/client/remote/Session.java @@ -102,6 +102,13 @@ public class Session { System.setSecurityManager(null); System.setProperty("http.nonProxyHosts", "code.google.com"); System.setProperty("socksNonProxyHosts", "code.google.com"); + + // clear previous values + System.clearProperty("socksProxyHost"); + System.clearProperty("socksProxyPort"); + System.clearProperty("http.proxyHost"); + System.clearProperty("http.proxyPort"); + switch (connection.getProxyType()) { case SOCKS: System.setProperty("socksProxyHost", connection.getProxyHost()); @@ -112,12 +119,6 @@ public class Session { System.setProperty("http.proxyPort", Integer.toString(connection.getProxyPort())); Authenticator.setDefault(new MageAuthenticator(connection.getProxyUsername(), connection.getProxyPassword())); break; - default: - System.clearProperty("socksProxyHost"); - System.clearProperty("socksProxyPort"); - System.clearProperty("http.proxyHost"); - System.clearProperty("http.proxyPort"); - break; } Registry reg = LocateRegistry.getRegistry(connection.getHost(), connection.getPort()); this.server = (Server) reg.lookup(Config.remoteServer);