Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
StackExchange.Redis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tsai
StackExchange.Redis
Commits
d032d31a
Commit
d032d31a
authored
Apr 23, 2014
by
Marc Gravell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
UseSsl => Ssl for consistency
parent
6facc80c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
13 deletions
+20
-13
DefaultPorts.cs
StackExchange.Redis.Tests/DefaultPorts.cs
+1
-1
SSL.cs
StackExchange.Redis.Tests/SSL.cs
+2
-2
ConfigurationOptions.cs
...xchange.Redis/StackExchange/Redis/ConfigurationOptions.cs
+16
-9
PhysicalConnection.cs
...kExchange.Redis/StackExchange/Redis/PhysicalConnection.cs
+1
-1
No files found.
StackExchange.Redis.Tests/DefaultPorts.cs
View file @
d032d31a
...
...
@@ -49,7 +49,7 @@ public void ConfigManualWithDefaultPorts(string host, int port, bool useSsl, int
{
options
.
EndPoints
.
Add
(
host
,
port
);
}
if
(
useSsl
)
options
.
Use
Ssl
=
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
);
...
...
StackExchange.Redis.Tests/SSL.cs
View file @
d032d31a
...
...
@@ -40,7 +40,7 @@ public void ConnectToSSLServer(bool useSsl, bool specifyHost)
};
if
(
useSsl
)
{
config
.
Use
Ssl
=
useSsl
;
config
.
Ssl
=
useSsl
;
if
(
specifyHost
)
{
config
.
SslHost
=
host
;
...
...
@@ -146,7 +146,7 @@ public void RedisLabsSSL()
#if LOGOUTPUT
ConnectionMultiplexer
.
EchoPath
=
Me
();
#endif
options
.
Use
Ssl
=
true
;
options
.
Ssl
=
true
;
options
.
CertificateSelection
+=
delegate
{
return
new
X509Certificate2
(
pfxPath
,
""
);
};
...
...
StackExchange.Redis/StackExchange/Redis/ConfigurationOptions.cs
View file @
d032d31a
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="
,
UseS
slPrefix
=
"ssl="
,
SslHostPrefix
=
"sslHost="
,
TieBreakerPrefix
=
"tiebreaker="
,
WriteBufferPrefix
=
"writeBuffer="
,
s
slPrefix
=
"ssl="
,
SslHostPrefix
=
"sslHost="
,
ConfigChannelPrefix
=
"configChannel="
,
AbortOnConnectFailPrefix
=
"abortConnect="
,
ResolveDnsPrefix
=
"resolveDns="
,
ChannelPrefixPrefix
=
"channelPrefix="
,
ProxyPrefix
=
"proxy="
;
private
readonly
EndPointCollection
endpoints
=
new
EndPointCollection
();
private
bool
?
allowAdmin
,
abortOnConnectFail
,
resolveDns
,
useS
sl
;
private
bool
?
allowAdmin
,
abortOnConnectFail
,
resolveDns
,
s
sl
;
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
=
useS
sl
,
ssl
=
s
sl
,
sslHost
=
sslHost
,
configChannel
=
configChannel
,
abortOnConnectFail
=
abortOnConnectFail
,
...
...
@@ -236,7 +243,7 @@ public ConfigurationOptions Clone()
/// </summary>
public
void
SetDefaultPorts
()
{
endpoints
.
SetDefaultPorts
(
Use
Ssl
?
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
,
useS
sl
);
Append
(
sb
,
sslPrefix
,
s
sl
);
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
=
useS
sl
=
null
;
allowAdmin
=
abortOnConnectFail
=
resolveDns
=
s
sl
=
null
;
defaultVersion
=
null
;
endpoints
.
Clear
();
commandMap
=
null
;
...
...
@@ -443,10 +450,10 @@ private void DoParse(string configuration)
{
TieBreaker
=
value
.
Trim
();
}
else
if
(
IsOption
(
option
,
UseS
slPrefix
))
else
if
(
IsOption
(
option
,
s
slPrefix
))
{
bool
tmp
;
if
(
Format
.
TryParseBoolean
(
value
.
Trim
(),
out
tmp
))
Use
Ssl
=
tmp
;
if
(
Format
.
TryParseBoolean
(
value
.
Trim
(),
out
tmp
))
Ssl
=
tmp
;
}
else
if
(
IsOption
(
option
,
SslHostPrefix
))
{
...
...
StackExchange.Redis/StackExchange/Redis/PhysicalConnection.cs
View file @
d032d31a
...
...
@@ -526,7 +526,7 @@ SocketMode ISocketCallback.Connected(Stream stream)
// [network]<==[ssl]<==[logging]<==[buffered]
var
config
=
multiplexer
.
RawConfig
;
if
(
config
.
Use
Ssl
)
if
(
config
.
Ssl
)
{
var
host
=
config
.
SslHost
;
if
(
string
.
IsNullOrWhiteSpace
(
host
))
host
=
Format
.
ToStringHostOnly
(
bridge
.
ServerEndPoint
.
EndPoint
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment