Why rely on the default http client? Why not create one with HttpClients.custom() .setDefaultSocketConfig(socketConfig) .setDefaultRequestConfig(requestConfig) .setSSLSocketFactory(sslsf) .build();
that has the SSLConnectionSocketFactory property set up with an SSLContext that has the trust store and key store loaded properly? Best, --J. On 17.11.2014 18:41, Bai Shen wrote: > I had seen where I could pass in an HttpClient to the SolrServer. The > problem is that the HttpClient only receives the authentication information > through the execute method using the context. See the example located here. > > https://hc.apache.org/httpcomponents-client-4.3.x/tutorial/html/authentication.html > > DefaultHttpClient has methods to set the authentication information but the > class is deprecated. > > Thanks. > > On Mon, Nov 17, 2014 at 11:35 AM, Fuad Efendi <f...@efendi.ca> wrote: > >>> I can >>> manually create an httpclient and set up authentication but then I can't >> use solrj. >> >> Yes; correct; except that you _can_ use solj with this custom HttpClient >> instance (which will intercept authentication, which will support cookies, >> SSL or plain HTTP, Keep-Alive, and etc.) >> >> You can provide to SolrJ custom HttpClient at construction: >> >> final HttpSolrServer myHttpSolrServer = >> new HttpSolrServer( >> SOLR_URL_BASE + "/" + SOLR_CORE_NAME, >> myHttpClient); >> >> >> Best Regards, >> >> http://www.tokenizer.ca >> >> >> -----Original Message----- >> From: Anurag Sharma [mailto:anura...@gmail.com] >> Sent: November-17-14 11:21 AM >> To: solr-user@lucene.apache.org >> Subject: Re: Solr HTTP client authentication >> >> I think Solr encourage SSL than authentication >> >> On Mon, Nov 17, 2014 at 6:08 PM, Bai Shen <baishen.li...@gmail.com> wrote: >> >>> I am using solrj to connect to my solr server. However I need to >>> authenticate against the server and can not find out how to do so >>> using solrj. Is this possible or do I need to drop solrj? I can >>> manually create an httpclient and set up authentication but then I can't >> use solrj. >>> Thanks. >>> >> -- Mit freundlichen Grüßen/Kind regards/Cordialement vôtre/Atentamente/С уважением *i.A. Jürgen Wagner* Head of Competence Center "Intelligence" & Senior Cloud Consultant Devoteam GmbH, Industriestr. 3, 70565 Stuttgart, Germany Phone: +49 6151 868-8725, Fax: +49 711 13353-53, Mobile: +49 171 864 1543 E-Mail: juergen.wag...@devoteam.com <mailto:juergen.wag...@devoteam.com>, URL: www.devoteam.de <http://www.devoteam.de/> ------------------------------------------------------------------------ Managing Board: Jürgen Hatzipantelis (CEO) Address of Record: 64331 Weiterstadt, Germany; Commercial Register: Amtsgericht Darmstadt HRB 6450; Tax Number: DE 172 993 071