public Request authenticateProxy(Proxy paramProxy, Response paramResponse) { List localList = paramResponse.challenges(); paramResponse = paramResponse.request(); URL localURL = paramResponse.url(); int i = 0; int j = localList.size(); while (i < j) { Object localObject = (Challenge) localList.get(i); if ("Basic".equalsIgnoreCase(((Challenge) localObject).getScheme())) { InetSocketAddress localInetSocketAddress = (InetSocketAddress) paramProxy.address(); localObject = java.net.Authenticator.requestPasswordAuthentication( localInetSocketAddress.getHostName(), getConnectToInetAddress(paramProxy, localURL), localInetSocketAddress.getPort(), localURL.getProtocol(), ((Challenge) localObject).getRealm(), ((Challenge) localObject).getScheme(), localURL, Authenticator.RequestorType.PROXY); if (localObject != null) { paramProxy = Credentials.basic( ((PasswordAuthentication) localObject).getUserName(), new String(((PasswordAuthentication) localObject).getPassword())); return paramResponse.newBuilder().header("Proxy-Authorization", paramProxy).build(); } } i += 1; } return null; }
/* * Enabled aggressive block sorting */ @Override public Request authenticateProxy(Proxy object, Response object2) throws IOException { List<Challenge> list = object2.challenges(); object2 = object2.request(); URL uRL = object2.url(); int n2 = 0; int n3 = list.size(); while (n2 < n3) { InetSocketAddress inetSocketAddress; Object object3 = list.get(n2); if ("Basic".equalsIgnoreCase(object3.getScheme()) && (object3 = java.net.Authenticator.requestPasswordAuthentication( (inetSocketAddress = (InetSocketAddress) object.address()).getHostName(), this.getConnectToInetAddress((Proxy) object, uRL), inetSocketAddress.getPort(), uRL.getProtocol(), object3.getRealm(), object3.getScheme(), uRL, Authenticator.RequestorType.PROXY)) != null) { object = Credentials.basic(object3.getUserName(), new String(object3.getPassword())); return object2.newBuilder().header("Proxy-Authorization", (String) object).build(); } ++n2; } return null; }