/// <summary>
 /// Manages HTTP connection with Solr
 /// </summary>
 /// <param name="serverURL">URL to Solr</param>
 public SolrConnection(string serverURL)
 {
     ServerURL = serverURL;
     Timeout = -1;
     Cache = new NullCache();
     HttpWebRequestFactory = new HttpWebRequestFactory();
 }
示例#2
0
 /// <summary>
 /// Manages HTTP connection with Solr
 /// </summary>
 /// <param name="serverURL">URL to Solr</param>
 public SolrConnection(string serverURL)
 {
     ServerURL             = serverURL;
     Timeout               = -1;
     Cache                 = new NullCache();
     HttpWebRequestFactory = new HttpWebRequestFactory();
 }
示例#3
0
 /// <summary>
 /// Basic Auth
 /// </summary>
 /// <param name="serverURL"></param>
 /// <param name="username"></param>
 /// <param name="password"></param>
 public SolrConnection(string serverURL, string username, string password)
 {
     ServerURL = serverURL;
     Timeout = -1;
     Cache = new NullCache();
     HttpWebRequestFactory = new BasicAuthHttpWebRequestFactory(username, password);
 }
示例#4
0
        /// <summary>
        /// Manages HTTP connection with Solr
        /// </summary>
        /// <param name="serverURL">URL to Solr</param>
        public SolrConnection(string serverURL)
        {
            ServerURL             = serverURL;
            Timeout               = -1;
            Cache                 = new NullCache();
            HttpWebRequestFactory = new HttpWebRequestFactory();
            if (ConfigurationManager.AppSettings["UseHttp"] == null || (ConfigurationManager.AppSettings["UseHttp"] != null && ConfigurationManager.AppSettings["UseHttp"].ToLower() != "true"))
            {
                var certificatePath     = ConfigurationManager.AppSettings["CertificatePath"];
                var certificatePassword = ConfigurationManager.AppSettings["CertificatePass"];

                if (string.IsNullOrEmpty(certificatePath))
                {
                    throw new ArgumentException("Path to certificate not set in web.config");
                }

                Certificate = new X509Certificate2(certificatePath, certificatePassword);
            }
        }