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
4b047ec6
Commit
4b047ec6
authored
Jul 11, 2018
by
Marc Gravell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make TrustIssuer an instance method
parent
b816bf29
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
6 deletions
+8
-6
SSL.cs
StackExchange.Redis.Tests/SSL.cs
+1
-1
ConfigurationOptions.cs
...xchange.Redis/StackExchange/Redis/ConfigurationOptions.cs
+6
-4
PhysicalConnection.cs
...kExchange.Redis/StackExchange/Redis/PhysicalConnection.cs
+1
-1
No files found.
StackExchange.Redis.Tests/SSL.cs
View file @
4b047ec6
...
...
@@ -190,7 +190,7 @@ public void RedisLabsSSL()
},
false
)
};
options
.
CertificateValidation
+=
ConfigurationOptions
.
TrustIssuer
(
"redislabs_ca.pem"
);
options
.
TrustIssuer
(
"redislabs_ca.pem"
);
...
...
StackExchange.Redis/StackExchange/Redis/ConfigurationOptions.cs
View file @
4b047ec6
...
...
@@ -179,13 +179,15 @@ public static string TryNormalize(string value)
/// <summary>
/// Create a certificate validation check that checks against the supplied issuer even if not known by the machine
/// </summary>
public
static
RemoteCertificateValidationCallback
TrustIssuer
(
string
issuerCertificatePath
)
=>
TrustIssuer
(
new
X509Certificate2
(
issuerCertificatePath
));
public
void
TrustIssuer
(
string
issuerCertificatePath
)
=>
CertificateValidationCallback
=
TrustIssuerCallback
(
issuerCertificatePath
);
/// <summary>
/// Create a certificate validation check that checks against the supplied issuer even if not known by the machine
/// </summary>
public
static
RemoteCertificateValidationCallback
TrustIssuer
(
X509Certificate2
issuer
)
public
void
TrustIssuer
(
X509Certificate2
issuer
)
=>
CertificateValidationCallback
=
TrustIssuerCallback
(
issuer
);
internal
static
RemoteCertificateValidationCallback
TrustIssuerCallback
(
string
issuerCertificatePath
)
=>
TrustIssuerCallback
(
new
X509Certificate2
(
issuerCertificatePath
));
private
static
RemoteCertificateValidationCallback
TrustIssuerCallback
(
X509Certificate2
issuer
)
{
if
(
issuer
==
null
)
throw
new
ArgumentNullException
(
nameof
(
issuer
));
...
...
StackExchange.Redis/StackExchange/Redis/PhysicalConnection.cs
View file @
4b047ec6
...
...
@@ -949,7 +949,7 @@ private RemoteCertificateValidationCallback GetAmbientIssuerCertificateCallback(
try
{
var
issuerPath
=
Environment
.
GetEnvironmentVariable
(
"SERedis_IssuerCertPath"
);
if
(!
string
.
IsNullOrEmpty
(
issuerPath
))
return
ConfigurationOptions
.
TrustIssuer
(
issuerPath
);
if
(!
string
.
IsNullOrEmpty
(
issuerPath
))
return
ConfigurationOptions
.
TrustIssuer
Callback
(
issuerPath
);
}
catch
(
Exception
ex
)
{
...
...
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