public CloseableHttpClient newClient() throws IndyClientException { try { return factory.createClient( location, defaultHeaders ); } catch ( JHttpCException e ) { throw new IndyClientException( "Indy request failed: %s", e, e.getMessage() ); } }
throw new JHttpCException( "Location: " + location.getUri() + " is misconfigured! Key password cannot be empty." ); "Invalid configuration. Location: %s has an invalid client certificate! Error: %s", location.getUri(), e.getMessage() ), e ); throw new JHttpCException( "Failed to initialize SSL connection for repository: " + location.getUri() ); "Invalid configuration. Cannot initialize keystore for repository: %s. Error: %s", location.getUri(), e.getMessage() ), e ); throw new JHttpCException( "Failed to initialize SSL connection for repository: " + location.getUri() ); "Invalid configuration. Cannot initialize keystore for repository: %s. Error: %s", location.getUri(), e.getMessage() ), e ); throw new JHttpCException( "Failed to initialize SSL connection for repository: " + location.getUri() ); throw new JHttpCException( "Failed to initialize SSL connection for repository: " + location.getUri() ); throw new JHttpCException( "Failed to read client SSL key/certificate from: %s. Reason: %s", e, location, e.getMessage() ); throw new JHttpCException( "Failed to read client SSL key/certificate from: %s. Reason: %s", e, location, e.getMessage() ); "Invalid configuration. Location: %s has an invalid server certificate! Error: %s", location.getUri(), e.getMessage() ), e ); throw new JHttpCException( "Failed to initialize SSL connection for repository: " + location.getUri() ); "Invalid configuration. Cannot initialize keystore for repository: %s. Error: %s", location.getUri(), e.getMessage() ), e );
throw new JHttpCException( "Failed to decrypt key/certificate: %s", e, e.getMessage() );
throw new JHttpCException( "Failed to parse site URL for host and port: %s (site id: %s). Reason: %s", e, location.getUri(), location.getId(), e.getMessage() );
public HttpClientContext newContext() throws IndyClientException { try { return factory.createContext( location ); } catch ( JHttpCException e ) { throw new IndyClientException( "Indy request failed: %s", e, e.getMessage() ); } }
/** * Create http request context and apply site config. * @param siteId ID to represent the site. It is generally the hostname of target site. * @return * @throws IndyHttpException */ public HttpClientContext createContext( final String siteId ) throws IndyHttpException { try { return httpFactory.createContext( siteConfigLookup.lookup( siteId ) ); } catch ( JHttpCException e ) { throw new IndyHttpException( "Failed to create http client context: %s", e, e.getMessage() ); } }
/** * Create http client and apply site config. * @param siteId ID to represent the site. It is generally the hostname of target site. * @return * @throws IndyHttpException */ public CloseableHttpClient createClient( final String siteId ) throws IndyHttpException { try { return httpFactory.createClient( siteConfigLookup.lookup( siteId ) ); } catch ( JHttpCException e ) { throw new IndyHttpException( "Failed to create http client: %s", e, e.getMessage() ); } }
throw new TransferLocationException( location, "Failed to initialize http client: %s", e, e.getMessage() );