Commit d032d31a authored by Marc Gravell's avatar Marc Gravell

UseSsl => Ssl for consistency

parent 6facc80c
......@@ -49,7 +49,7 @@ public void ConfigManualWithDefaultPorts(string host, int port, bool useSsl, int
{
options.EndPoints.Add(host, port);
}
if (useSsl) options.UseSsl = true;
if (useSsl) options.Ssl = true;
options.SetDefaultPorts(); // normally it is the multiplexer that calls this, not us
Assert.AreEqual(expectedPort, ((DnsEndPoint)options.EndPoints.Single()).Port);
......
......@@ -40,7 +40,7 @@ public void ConnectToSSLServer(bool useSsl, bool specifyHost)
};
if(useSsl)
{
config.UseSsl = useSsl;
config.Ssl = useSsl;
if (specifyHost)
{
config.SslHost = host;
......@@ -146,7 +146,7 @@ public void RedisLabsSSL()
#if LOGOUTPUT
ConnectionMultiplexer.EchoPath = Me();
#endif
options.UseSsl = true;
options.Ssl = true;
options.CertificateSelection += delegate {
return new X509Certificate2(pfxPath, "");
};
......
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
using System.Net;
using System.Net.Security;
......@@ -34,13 +35,13 @@ public sealed class ConfigurationOptions : ICloneable
private const string AllowAdminPrefix = "allowAdmin=", SyncTimeoutPrefix = "syncTimeout=",
ServiceNamePrefix = "serviceName=", ClientNamePrefix = "name=", KeepAlivePrefix = "keepAlive=",
VersionPrefix = "version=", ConnectTimeoutPrefix = "connectTimeout=", PasswordPrefix = "password=",
TieBreakerPrefix = "tiebreaker=", WriteBufferPrefix = "writeBuffer=", UseSslPrefix = "ssl=", SslHostPrefix = "sslHost=",
TieBreakerPrefix = "tiebreaker=", WriteBufferPrefix = "writeBuffer=", sslPrefix = "ssl=", SslHostPrefix = "sslHost=",
ConfigChannelPrefix = "configChannel=", AbortOnConnectFailPrefix = "abortConnect=", ResolveDnsPrefix = "resolveDns=",
ChannelPrefixPrefix = "channelPrefix=", ProxyPrefix = "proxy=";
private readonly EndPointCollection endpoints = new EndPointCollection();
private bool? allowAdmin, abortOnConnectFail, resolveDns, useSsl;
private bool? allowAdmin, abortOnConnectFail, resolveDns, ssl;
private string clientName, serviceName, password, tieBreaker, sslHost, configChannel;
......@@ -79,7 +80,13 @@ public sealed class ConfigurationOptions : ICloneable
/// <summary>
/// Indicates whether the connection should be encrypted
/// </summary>
public bool UseSsl { get { return useSsl.GetValueOrDefault(); } set { useSsl = value; } }
[Obsolete("Please use .Ssl instead of .UseSsl"), Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public bool UseSsl { get { return Ssl; } set { Ssl = value; } }
/// <summary>
/// Indicates whether the connection should be encrypted
/// </summary>
public bool Ssl { get { return ssl.GetValueOrDefault(); } set { ssl = value; } }
/// <summary>
/// Automatically encodes and decodes channels
......@@ -213,7 +220,7 @@ public ConfigurationOptions Clone()
password = password,
tieBreaker = tieBreaker,
writeBuffer = writeBuffer,
useSsl = useSsl,
ssl = ssl,
sslHost = sslHost,
configChannel = configChannel,
abortOnConnectFail = abortOnConnectFail,
......@@ -236,7 +243,7 @@ public ConfigurationOptions Clone()
/// </summary>
public void SetDefaultPorts()
{
endpoints.SetDefaultPorts(UseSsl ? 6380 : 6379);
endpoints.SetDefaultPorts(Ssl ? 6380 : 6379);
}
/// <summary>
......@@ -259,7 +266,7 @@ public override string ToString()
Append(sb, PasswordPrefix, password);
Append(sb, TieBreakerPrefix, tieBreaker);
Append(sb, WriteBufferPrefix, writeBuffer);
Append(sb, UseSslPrefix, useSsl);
Append(sb, sslPrefix, ssl);
Append(sb, SslHostPrefix, sslHost);
Append(sb, ConfigChannelPrefix, configChannel);
Append(sb, AbortOnConnectFailPrefix, abortOnConnectFail);
......@@ -352,7 +359,7 @@ void Clear()
{
clientName = serviceName = password = tieBreaker = sslHost = configChannel = null;
keepAlive = syncTimeout = connectTimeout = writeBuffer = null;
allowAdmin = abortOnConnectFail = resolveDns = useSsl = null;
allowAdmin = abortOnConnectFail = resolveDns = ssl = null;
defaultVersion = null;
endpoints.Clear();
commandMap = null;
......@@ -443,10 +450,10 @@ private void DoParse(string configuration)
{
TieBreaker = value.Trim();
}
else if (IsOption(option, UseSslPrefix))
else if (IsOption(option, sslPrefix))
{
bool tmp;
if (Format.TryParseBoolean(value.Trim(), out tmp)) UseSsl = tmp;
if (Format.TryParseBoolean(value.Trim(), out tmp)) Ssl = tmp;
}
else if (IsOption(option, SslHostPrefix))
{
......
......@@ -526,7 +526,7 @@ SocketMode ISocketCallback.Connected(Stream stream)
// [network]<==[ssl]<==[logging]<==[buffered]
var config = multiplexer.RawConfig;
if(config.UseSsl)
if(config.Ssl)
{
var host = config.SslHost;
if (string.IsNullOrWhiteSpace(host)) host = Format.ToStringHostOnly(bridge.ServerEndPoint.EndPoint);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment