/// <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(); }
/// <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(); }
/// <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); }
/// <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); } }