diff --git a/Matrix.Sdk/Matrix.Sdk.csproj b/Matrix.Sdk/Matrix.Sdk.csproj index 2a04513..681d745 100644 --- a/Matrix.Sdk/Matrix.Sdk.csproj +++ b/Matrix.Sdk/Matrix.Sdk.csproj @@ -14,7 +14,7 @@ Mikhail Tatarenko Matrix.Sdk This open-source library allows you to build .NET apps compatible with Matrix Protocol - http://www.matrix.org. - 1.0.2 + 1.0.3 Copyright © Baking Bad 2019-2022 enable netstandard2.0 diff --git a/Matrix.Sdk/MatrixClientFactory.cs b/Matrix.Sdk/MatrixClientFactory.cs index 3c7871b..b8c078f 100644 --- a/Matrix.Sdk/MatrixClientFactory.cs +++ b/Matrix.Sdk/MatrixClientFactory.cs @@ -7,12 +7,19 @@ namespace Matrix.Sdk public class SingletonHttpFactory : IHttpClientFactory { - private readonly HttpClient _httpClient = new(); - + private readonly HttpClient _httpClient; + + public SingletonHttpFactory() + { + var httpClientHandler = new HttpClientHandler + { ServerCertificateCustomValidationCallback = (_, _, _, _) => true }; + _httpClient = new HttpClient(httpClientHandler); + } + public HttpClient CreateClient(string name) => _httpClient; - } - - + } + + public class MatrixClientFactory { private readonly SingletonHttpFactory _httpClientFactory = new();