static SecureTransportContext()
        {
            const string Default = "Default";
            const string None    = "None";

            SupportedProtocols      = new List <string>();
            SupportedProtocolValues = new Dictionary <string, int>();
            foreach (string name in Enum.GetNames(typeof(System.Security.Authentication.SslProtocols)))
            {
                if (name.Equals(Default, StringComparison.CurrentCultureIgnoreCase) ||
                    name.Equals(None, StringComparison.CurrentCultureIgnoreCase))
                {
                    // ignore
                }
                else
                {
                    SupportedProtocols.Add(name);
                }
            }
            foreach (int value in Enum.GetValues(typeof(System.Security.Authentication.SslProtocols)))
            {
                SslProtocols p = (System.Security.Authentication.SslProtocols)value;
                if (p.Equals(SslProtocols.Default) ||
                    p.Equals(SslProtocols.None))
                {
                    // ignore
                }
                else
                {
                    string name = ((SslProtocols)value).ToString().ToLower();
                    SupportedProtocolValues.Add(name, value);
                }
            }
            if (Tracer.IsDebugEnabled)
            {
                Tracer.DebugFormat("Supported SSL protocols list {0}", Util.PropertyUtil.ToString(SupportedProtocols));
            }
        }
Ejemplo n.º 2
0
 protected bool Equals(RedisEndpoint other)
 {
     return(string.Equals(Host, other.Host) &&
            Port == other.Port &&
            Ssl.Equals(other.Ssl) &&
            SslProtocols.Equals(other.SslProtocols) &&
            ConnectTimeout == other.ConnectTimeout &&
            SendTimeout == other.SendTimeout &&
            ReceiveTimeout == other.ReceiveTimeout &&
            RetryTimeout == other.RetryTimeout &&
            IdleTimeOutSecs == other.IdleTimeOutSecs &&
            Db == other.Db &&
            string.Equals(Client, other.Client) &&
            string.Equals(Password, other.Password) &&
            string.Equals(NamespacePrefix, other.NamespacePrefix));
 }