Hi,

not sure, have you tried to add proxy configuration for https ?

System.setProperty("https.proxyHost", ProxyHost);
System.setProperty("https.proxyPort", ProxyPort);


Bests,
Vincenzo

On Thu, Sep 29, 2016 at 10:12 AM, Preeti Bhat <preeti.b...@shoregrp.com>
wrote:

> HI All,
>
> Pinging this again. Could someone please advise.
>
>
> Thanks and Regards,
> Preeti Bhat
>
> From: Preeti Bhat
> Sent: Wednesday, September 28, 2016 7:14 PM
> To: solr-user@lucene.apache.org
> Subject: Connect to SolrCloud using proxy in SolrJ
>
> Hi All,
>
> I am trying to connect to the Solrcloud using the zookeeper host string in
> my java application(CloudSolrClient). I am able to connect to the solrcloud
> when there are no proxy settings needed, but when trying to connect to the
> code using proxy settings, I am getting the below error.
>
>
> 1)      Without Proxy
>
> System.setProperty("javax.net.ssl.keyStore", keyStore);
>
> System.setProperty("javax.net.ssl.keyStorePassword", keyStorePsswd);
>
> System.setProperty("javax.net.ssl.trustStore", trustStore);
>
> System.setProperty("javax.net.ssl.trustStorePassword", trustStorePsswd);
>
>
> HttpClientBuilder builder = HttpClientBuilder.create();
>        builder.useSystemProperties();
>        CloseableHttpClient httpclient = builder.build();
> cloud_client = new CloudSolrClient(zkHost, httpclient);
> @SuppressWarnings("rawtypes")
> SolrRequest req = new QueryRequest();
> req.setBasicAuthCredentials(UserName, Password);
>        cloud_client.request(req, collectionName);
>
> cloud_client.setDefaultCollection(collectionName);
>
> 2)      With Proxy code
>
> System.setProperty("javax.net.ssl.keyStore", keyStore);
>
> System.setProperty("javax.net.ssl.keyStorePassword", keyStorePsswd);
>
> System.setProperty("javax.net.ssl.trustStore", trustStore);
>
> System.setProperty("javax.net.ssl.trustStorePassword", trustStorePsswd);
> System.setProperty("http.proxyHost", ProxyHost);
> System.setProperty("http.proxyPort", ProxyPort);
> HttpHost proxy = new HttpHost(ProxyHost, Integer.parseInt(ProxyPort));
> RequestConfig defaultRequestConfig = RequestConfig.custom()
>                                          .setProxy(new HttpHost(ProxyHost,
> Integer.parseInt(ProxyPort))).build();
>
> HttpGet httpget = new HttpGet();
> httpget.setConfig(defaultRequestConfig);
>
> HttpClientBuilder builder = HttpClientBuilder.create();
> builder.useSystemProperties();
> CloseableHttpClient httpclient = builder.build();
> httpclient.execute(proxy, httpget);
> cloud_client = new CloudSolrClient(zkHost, httpclient);
> @SuppressWarnings("rawtypes")
> SolrRequest req = new QueryRequest();
> req.setBasicAuthCredentials(UserName, Password);
> cloud_client.request(req, collectionName);
> cloud_client.setDefaultCollection(collectionName);
>
>
> Please note that the Zookeepers are already whitelisted in the proxy under
> TCP protocol & SOLR servers are under https protocol.
> Could someone please advise on this??
>
> Thanks and Regards,
> Preeti Bhat
>
>
>
> NOTICE TO RECIPIENTS: This communication may contain confidential and/or
> privileged information. If you are not the intended recipient (or have
> received this communication in error) please notify the sender and
> it-supp...@shoregrp.com immediately, and destroy this communication. Any
> unauthorized copying, disclosure or distribution of the material in this
> communication is strictly forbidden. Any views or opinions presented in
> this email are solely those of the author and do not necessarily represent
> those of the company. Finally, the recipient should check this email and
> any attachments for the presence of viruses. The company accepts no
> liability for any damage caused by any virus transmitted by this email.
>
>
>


-- 
Vincenzo D'Amore
email: v.dam...@gmail.com
skype: free.dev
mobile: +39 349 8513251

Reply via email to