Changed references of DefaultHttpClient to SystemDefaultHttpClient to inherit system proxy settings, should address #548
parent
59b1373460
commit
1289d4737a
|
@ -26,7 +26,8 @@ import java.util.HashSet;
|
|||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.http.impl.client.DefaultHttpClient;
|
||||
import org.apache.http.client.HttpClient;
|
||||
import org.apache.http.impl.client.SystemDefaultHttpClient;
|
||||
import org.mitre.oauth2.introspectingfilter.service.IntrospectionAuthorityGranter;
|
||||
import org.mitre.oauth2.introspectingfilter.service.IntrospectionConfigurationService;
|
||||
import org.mitre.oauth2.introspectingfilter.service.impl.SimpleIntrospectionAuthorityGranter;
|
||||
|
@ -66,7 +67,7 @@ public class IntrospectingTokenService implements ResourceServerTokenServices {
|
|||
private IntrospectionConfigurationService introspectionConfigurationService;
|
||||
private IntrospectionAuthorityGranter introspectionAuthorityGranter = new SimpleIntrospectionAuthorityGranter();
|
||||
|
||||
private DefaultHttpClient httpClient = new DefaultHttpClient();
|
||||
private HttpClient httpClient = new SystemDefaultHttpClient();
|
||||
private HttpComponentsClientHttpRequestFactory factory = new HttpComponentsClientHttpRequestFactory(httpClient);
|
||||
|
||||
// Inner class to store in the hash map
|
||||
|
|
|
@ -32,7 +32,8 @@ import javax.servlet.http.HttpServletRequest;
|
|||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
|
||||
import org.apache.http.impl.client.DefaultHttpClient;
|
||||
import org.apache.http.client.HttpClient;
|
||||
import org.apache.http.impl.client.SystemDefaultHttpClient;
|
||||
import org.mitre.jwt.signer.service.JwtSigningAndValidationService;
|
||||
import org.mitre.jwt.signer.service.impl.JWKSetCacheService;
|
||||
import org.mitre.oauth2.model.RegisteredClient;
|
||||
|
@ -267,7 +268,7 @@ public class OIDCAuthenticationFilter extends AbstractAuthenticationProcessingFi
|
|||
}
|
||||
|
||||
// Handle Token Endpoint interaction
|
||||
DefaultHttpClient httpClient = new DefaultHttpClient();
|
||||
HttpClient httpClient = new SystemDefaultHttpClient();
|
||||
|
||||
httpClient.getParams().setParameter("http.socket.timeout", new Integer(httpSocketTimeout));
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
package org.mitre.openid.connect.client;
|
||||
|
||||
import org.apache.http.client.HttpClient;
|
||||
import org.apache.http.impl.client.DefaultHttpClient;
|
||||
import org.apache.http.impl.client.SystemDefaultHttpClient;
|
||||
import org.mitre.openid.connect.config.ServerConfiguration;
|
||||
import org.mitre.openid.connect.model.DefaultUserInfo;
|
||||
import org.mitre.openid.connect.model.OIDCAuthenticationToken;
|
||||
|
@ -57,8 +57,7 @@ public class UserInfoFetcher {
|
|||
}
|
||||
|
||||
// if we got this far, try to actually get the userinfo
|
||||
|
||||
HttpClient httpClient = new DefaultHttpClient();
|
||||
HttpClient httpClient = new SystemDefaultHttpClient();
|
||||
|
||||
HttpComponentsClientHttpRequestFactory factory = new HttpComponentsClientHttpRequestFactory(httpClient);
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ import java.util.Set;
|
|||
import java.util.concurrent.ExecutionException;
|
||||
|
||||
import org.apache.http.client.HttpClient;
|
||||
import org.apache.http.impl.client.DefaultHttpClient;
|
||||
import org.apache.http.impl.client.SystemDefaultHttpClient;
|
||||
import org.mitre.oauth2.model.RegisteredClient;
|
||||
import org.mitre.openid.connect.ClientDetailsEntityJsonProcessor;
|
||||
import org.mitre.openid.connect.client.service.ClientConfigurationService;
|
||||
|
@ -162,7 +162,7 @@ public class DynamicRegistrationClientConfigurationService implements ClientConf
|
|||
*
|
||||
*/
|
||||
public class DynamicClientRegistrationLoader extends CacheLoader<ServerConfiguration, RegisteredClient> {
|
||||
private HttpClient httpClient = new DefaultHttpClient();
|
||||
private HttpClient httpClient = new SystemDefaultHttpClient();
|
||||
private HttpComponentsClientHttpRequestFactory httpFactory = new HttpComponentsClientHttpRequestFactory(httpClient);
|
||||
private Gson gson = new Gson(); // note that this doesn't serialize nulls by default
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ import java.util.Set;
|
|||
import java.util.concurrent.ExecutionException;
|
||||
|
||||
import org.apache.http.client.HttpClient;
|
||||
import org.apache.http.impl.client.DefaultHttpClient;
|
||||
import org.apache.http.impl.client.SystemDefaultHttpClient;
|
||||
import org.mitre.openid.connect.client.service.ServerConfigurationService;
|
||||
import org.mitre.openid.connect.config.ServerConfiguration;
|
||||
import org.slf4j.Logger;
|
||||
|
@ -47,6 +47,13 @@ import com.google.gson.JsonElement;
|
|||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParser;
|
||||
|
||||
import static org.mitre.discovery.util.JsonUtils.getAsBoolean;
|
||||
import static org.mitre.discovery.util.JsonUtils.getAsEncryptionMethodList;
|
||||
import static org.mitre.discovery.util.JsonUtils.getAsJweAlgorithmList;
|
||||
import static org.mitre.discovery.util.JsonUtils.getAsJwsAlgorithmList;
|
||||
import static org.mitre.discovery.util.JsonUtils.getAsString;
|
||||
import static org.mitre.discovery.util.JsonUtils.getAsStringList;
|
||||
|
||||
/**
|
||||
*
|
||||
* Dynamically fetches OpenID Connect server configurations based on the issuer. Caches the server configurations.
|
||||
|
@ -122,7 +129,7 @@ public class DynamicServerConfigurationService implements ServerConfigurationSer
|
|||
*
|
||||
*/
|
||||
private class OpenIDConnectServiceConfigurationFetcher extends CacheLoader<String, ServerConfiguration> {
|
||||
private HttpClient httpClient = new DefaultHttpClient();
|
||||
private HttpClient httpClient = new SystemDefaultHttpClient();
|
||||
private HttpComponentsClientHttpRequestFactory httpFactory = new HttpComponentsClientHttpRequestFactory(httpClient);
|
||||
private JsonParser parser = new JsonParser();
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ import javax.servlet.http.HttpServletRequest;
|
|||
|
||||
import org.apache.http.client.HttpClient;
|
||||
import org.apache.http.client.utils.URIBuilder;
|
||||
import org.apache.http.impl.client.DefaultHttpClient;
|
||||
import org.apache.http.impl.client.SystemDefaultHttpClient;
|
||||
import org.mitre.discovery.util.WebfingerURLNormalizer;
|
||||
import org.mitre.openid.connect.client.model.IssuerServiceResponse;
|
||||
import org.mitre.openid.connect.client.service.IssuerService;
|
||||
|
@ -168,7 +168,7 @@ public class WebfingerIssuerService implements IssuerService {
|
|||
*
|
||||
*/
|
||||
private class WebfingerIssuerFetcher extends CacheLoader<UriComponents, String> {
|
||||
private HttpClient httpClient = new DefaultHttpClient();
|
||||
private HttpClient httpClient = new SystemDefaultHttpClient();
|
||||
private HttpComponentsClientHttpRequestFactory httpFactory = new HttpComponentsClientHttpRequestFactory(httpClient);
|
||||
private JsonParser parser = new JsonParser();
|
||||
|
||||
|
|
|
@ -24,6 +24,7 @@ import java.util.concurrent.TimeUnit;
|
|||
|
||||
import org.apache.http.client.HttpClient;
|
||||
import org.apache.http.impl.client.DefaultHttpClient;
|
||||
import org.apache.http.impl.client.SystemDefaultHttpClient;
|
||||
import org.mitre.jose.keystore.JWKSetKeyStore;
|
||||
import org.mitre.jwt.encryption.service.JwtEncryptionAndDecryptionService;
|
||||
import org.mitre.jwt.encryption.service.impl.DefaultJwtEncryptionAndDecryptionService;
|
||||
|
@ -98,7 +99,7 @@ public class JWKSetCacheService {
|
|||
*
|
||||
*/
|
||||
private class JWKSetVerifierFetcher extends CacheLoader<String, JwtSigningAndValidationService> {
|
||||
private HttpClient httpClient = new DefaultHttpClient();
|
||||
private HttpClient httpClient = new SystemDefaultHttpClient();
|
||||
private HttpComponentsClientHttpRequestFactory httpFactory = new HttpComponentsClientHttpRequestFactory(httpClient);
|
||||
private RestTemplate restTemplate = new RestTemplate(httpFactory);
|
||||
|
||||
|
@ -122,11 +123,11 @@ public class JWKSetCacheService {
|
|||
}
|
||||
|
||||
/**
|
||||
* @author jricher
|
||||
*
|
||||
*/
|
||||
private class JWKSetEncryptorFetcher extends CacheLoader<String, JwtEncryptionAndDecryptionService> {
|
||||
private HttpClient httpClient = new DefaultHttpClient();
|
||||
* @author jricher
|
||||
*
|
||||
*/
|
||||
private class JWKSetEncryptorFetcher extends CacheLoader<String, JwtEncryptionAndDecryptionService> {
|
||||
private HttpClient httpClient = new SystemDefaultHttpClient();
|
||||
private HttpComponentsClientHttpRequestFactory httpFactory = new HttpComponentsClientHttpRequestFactory(httpClient);
|
||||
private RestTemplate restTemplate = new RestTemplate(httpFactory);
|
||||
/* (non-Javadoc)
|
||||
|
|
Loading…
Reference in New Issue