@Create public void create() { Protocol.registerProtocol("https", new Protocol("https", new EasySSLProtocolSocketFactory(), 8443)); this.httpClient = new HttpClient(); this.httpClient.getParams().setAuthenticationPreemptive(true); Credentials defaultcreds = new UsernamePasswordCredentials("admin", this.entityManager.find(CommandParameter.class, CommandParameter.HERITRIX_ADMINPW_KEY) .getCommandValue()); this.httpClient.getState().setCredentials( new AuthScope(AuthScope.ANY_SCHEME, AuthScope.ANY_PORT, AuthScope.ANY_REALM), defaultcreds); this.engineUri = this.entityManager.find(Parameter.class, Parameter.ENGINE_URI.getKey()).getValue(); Logger httpClientlogger = Logger.getLogger(this.httpClient.getClass()); httpClientlogger.setLevel(Level.ERROR); Logger authChallengeProcessorLogger = Logger .getLogger(AuthChallengeProcessor.class); authChallengeProcessorLogger.setLevel(Level.ERROR); Logger httpMethodBaseLogger = Logger.getLogger(HttpMethodBase.class); httpMethodBaseLogger.setLevel(Level.ERROR); this.jobsDir = this.entityManager.find(Parameter.class, Parameter.JOBS_DIR.getKey()).getValue(); }
private void create() { Protocol.registerProtocol("https", new Protocol("https", new EasySSLProtocolSocketFactory(), 8443)); this.httpClient = new HttpClient(); this.httpClient.getParams().setAuthenticationPreemptive(true); Credentials defaultcreds = new UsernamePasswordCredentials("admin", this.entityManager.find(CommandParameter.class, CommandParameter.HERITRIX_ADMINPW_KEY) .getCommandValue()); this.httpClient.getState().setCredentials( new AuthScope(AuthScope.ANY_SCHEME, AuthScope.ANY_PORT, AuthScope.ANY_REALM), defaultcreds); this.engineUri = this.entityManager.find(Parameter.class, Parameter.ENGINE_URI.getKey()).getValue(); Logger httpClientlogger = Logger.getLogger(this.httpClient.getClass()); httpClientlogger.setLevel(Level.ERROR); Logger authChallengeProcessorLogger = Logger .getLogger(AuthChallengeProcessor.class); authChallengeProcessorLogger.setLevel(Level.ERROR); Logger httpMethodBaseLogger = Logger.getLogger(HttpMethodBase.class); httpMethodBaseLogger.setLevel(Level.ERROR); this.jobsDir = this.entityManager.find(Parameter.class, Parameter.JOBS_DIR.getKey()).getValue(); }
public HttpMethodDirector( final HttpConnectionManager connectionManager, final HostConfiguration hostConfiguration, final HttpClientParams params, final HttpState state ) { super(); this.connectionManager = connectionManager; this.hostConfiguration = hostConfiguration; this.params = params; this.state = state; this.authProcessor = new AuthChallengeProcessor(this.params); }