lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sky USC <sky...@hotmail.com>
Subject RE: How to use solrJ: Self-signed cert SSL + basic auth.
Date Fri, 02 Sep 2011 08:39:03 GMT

Think I got it.. it looks  something like following - however cant figure out where to get
"EasySSLProtocolSocketFactory" from Maven from a known source: 

            URL
solrUrl = new URL(uri);

            if
(solrUrl.getProtocol().equals("https") && isSSLSelfSigned)

            {

                  ProtocolSocketFactory
socketFactory = new EasySSLProtocolSocketFactory();

                  Protocol
https = new Protocol("https", socketFactory, 443);

                  Protocol.registerProtocol("https", https);

            }

            server = new
CommonsHttpSolrServer(solrUrl);

            if (isBasicAuth)

            {

                 ((CommonsHttpSolrServer)
server).getHttpClient().getParams().setAuthenticationPreemptive(true);

                  Credentials
defaultcreds = new UsernamePasswordCredentials(solrUName, solrPwd);

                  ((CommonsHttpSolrServer)
server).getHttpClient().getState().setCredentials(new
AuthScope(solrUrl.getHost(), 443, AuthScope.ANY_REALM),
defaultcreds);

            }


 > From: skyusc@hotmail.com
> To: solr-user@lucene.apache.org
> Subject: How to use solrJ: Self-signed cert SSL + basic auth.
> Date: Fri, 2 Sep 2011 00:19:13 -0700
> 
> I have solr 1.4.1 set up with following additions:
> 1. Basic authentication
> 2. SSL using self signed certificate
> 
> How do I use solrj to connect to this server?
> Thanks!
> - sky
 		 	   		  
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message