Changeset 10

User picture

Author: Frederik Heremans

(2009/03/27 15:58) About 3 years ago

Proxy authentication bug fixed

Affected files

Updated trunk/Traffide/src/be/stacktrace/traffide/http/HostConfigurationWrapper.java Download diff

910
22
        	credentials = new UsernamePasswordCredentials(username, password);        	
22
        	credentials = new UsernamePasswordCredentials(username, password);        	
23
        }
23
        }
24
        state = new HttpState();
24
        state = new HttpState();
25
        state.setCredentials(AuthScope.ANY, credentials);
25
        state.setProxyCredentials(AuthScope.ANY, credentials);
26
    }
26
    }
27
27
28
    public HostConfiguration getHostConfiguration() {
28
    public HostConfiguration getHostConfiguration() {
...
...
54
    
54
    
55
    public HttpState getHttpState() {
55
    public HttpState getHttpState() {
56
    	HttpState newState = new HttpState();
56
    	HttpState newState = new HttpState();
57
    	newState.setCredentials(AuthScope.ANY, state.getCredentials(AuthScope.ANY));
57
    	newState.setProxyCredentials(AuthScope.ANY, state.getProxyCredentials(AuthScope.ANY));
58
    	return newState;
58
    	return newState;
59
    }
59
    }
60
}
60
}

Updated trunk/Traffide/src/be/stacktrace/traffide/http/HttpClientWrapper.java Download diff

910
58
		// Get the hostConfiguration
58
		// Get the hostConfiguration
59
		HostConfigurationWrapper wrapper = hostConfigurationFactory
59
		HostConfigurationWrapper wrapper = hostConfigurationFactory
60
				.getHostConfigurationForHost(hostName);
60
				.getHostConfigurationForHost(hostName);
61
61
		
62
		// Execute the method
62
		// Execute the method
63
		httpClient.getParams().setAuthenticationPreemptive(true);
63
		httpClient.executeMethod(wrapper.getHostConfiguration(), method,
64
		httpClient.executeMethod(wrapper.getHostConfiguration(), method,
64
				wrapper.getHttpState());
65
				wrapper.getHttpState());
65
	}
66
	}