aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/HttpClientManager/HttpClientManager.cs
diff options
context:
space:
mode:
authorArtiume <siderite@gmail.com>2019-12-20 23:09:35 -0500
committerGitHub <noreply@github.com>2019-12-20 23:09:35 -0500
commit82911c8a20a538ad32fda7cb927624da79f769d5 (patch)
tree5264f2c72d7d4f6f5819b0c4cccd4d5395c9511b /Emby.Server.Implementations/HttpClientManager/HttpClientManager.cs
parent6a6e02e1ec23df06ab961d2c974263450871ae71 (diff)
parentda9a59de1e0837d2a4b030d59fa8d009b4457439 (diff)
Merge pull request #4 from stevehayles/server-validation
Allow valid https requests in .NET Core
Diffstat (limited to 'Emby.Server.Implementations/HttpClientManager/HttpClientManager.cs')
-rw-r--r--Emby.Server.Implementations/HttpClientManager/HttpClientManager.cs12
1 files changed, 11 insertions, 1 deletions
diff --git a/Emby.Server.Implementations/HttpClientManager/HttpClientManager.cs b/Emby.Server.Implementations/HttpClientManager/HttpClientManager.cs
index 50233ea48..ff51820ca 100644
--- a/Emby.Server.Implementations/HttpClientManager/HttpClientManager.cs
+++ b/Emby.Server.Implementations/HttpClientManager/HttpClientManager.cs
@@ -59,7 +59,17 @@ namespace Emby.Server.Implementations.HttpClientManager
if (!_httpClients.TryGetValue(key, out var client))
{
- client = new HttpClient()
+ var httpClientHandler = new HttpClientHandler()
+ {
+ ServerCertificateCustomValidationCallback = (message, cert, chain, errors) =>
+ {
+ var success = errors == System.Net.Security.SslPolicyErrors.None;
+ _logger.LogDebug("Validating certificate {Cert}. Success {1}", cert, success);
+ return success;
+ }
+ };
+
+ client = new HttpClient(httpClientHandler)
{
BaseAddress = new Uri(url)
};