Skip to content

Commit

Permalink
Disabled HTTP cetrificates validation;
Browse files Browse the repository at this point in the history
  • Loading branch information
k-karuna committed Aug 30, 2022
1 parent b0196e2 commit f89b1f1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Matrix.Sdk/Matrix.Sdk.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<Authors>Mikhail Tatarenko</Authors>
<Product>Matrix.Sdk</Product>
<Description>This open-source library allows you to build .NET apps compatible with Matrix Protocol - http://www.matrix.org.</Description>
<Version>1.0.2</Version>
<Version>1.0.3</Version>
<Copyright>Copyright © Baking Bad 2019-2022</Copyright>
<Nullable>enable</Nullable>
<TargetFramework>netstandard2.0</TargetFramework>
Expand Down
17 changes: 12 additions & 5 deletions Matrix.Sdk/MatrixClientFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit f89b1f1

Please sign in to comment.