Skip to content

Commit

Permalink
Merge pull request #78 from stebet/downloader-http-client-update
Browse files Browse the repository at this point in the history
Updating libraries
  • Loading branch information
stebet authored Oct 1, 2024
2 parents 823c738 + c5a8172 commit 82b472c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 17 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Installation

## Prerequisites
You'll need to install [.NET 6](https://dotnet.microsoft.com/en-us/download/dotnet/6.0) to be able to install the tool.
You'll need to install the latest LTS (Long Term Support) version of the [.NET SDK](https://dotnet.microsoft.com/en-us/download/dotnet/8.0) to be able to install the tool.

## How to install
1. Open a command line window
Expand Down
2 changes: 1 addition & 1 deletion src/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<Project>
<ItemGroup>
<PackageReference Include="DotNet.ReproducibleBuilds" Version="1.1.1" PrivateAssets="All"/>
<PackageReference Include="DotNet.ReproducibleBuilds" Version="1.2.25" PrivateAssets="All"/>
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<TargetFrameworks>net8.0;net7.0;net6.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<PackAsTool>true</PackAsTool>
Expand All @@ -14,11 +14,12 @@
<PackageIcon>hibp.png</PackageIcon>
<PackageTags>haveibeenpwned hibp pwnedpasswords security password</PackageTags>
<PackageReadmeFile>README.md</PackageReadmeFile>
<ServerGarbageCollection>true</ServerGarbageCollection>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="8.5.0" />
<PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="8.9.1" />
<PackageReference Include="Spectre.Console.Cli" Version="0.49.1" />
<PackageReference Include="System.IO.Pipelines" Version="8.0.0" />
</ItemGroup>
Expand Down
18 changes: 5 additions & 13 deletions src/HaveIBeenPwned.PwnedPasswords.Downloader/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,11 @@ static IHostBuilder CreateHostBuilder(string[] args) =>
{
services
.AddHttpClient("PwnedPasswords")
.ConfigurePrimaryHttpMessageHandler(() =>
.UseSocketsHttpHandler((handler, provider) =>
{
var handler = new HttpClientHandler();

if (handler.SupportsAutomaticDecompression)
{
handler.AutomaticDecompression = DecompressionMethods.All;
handler.SslProtocols = System.Security.Authentication.SslProtocols.Tls13 | System.Security.Authentication.SslProtocols.Tls12;
}

return handler;
handler.AutomaticDecompression = DecompressionMethods.All;
handler.SslOptions.EnabledSslProtocols = System.Security.Authentication.SslProtocols.Tls13 | System.Security.Authentication.SslProtocols.Tls12;
handler.EnableMultipleHttp2Connections = true;
})
.ConfigureHttpClient(client =>
{
Expand All @@ -69,10 +63,8 @@ static IHostBuilder CreateHostBuilder(string[] args) =>
client.DefaultRequestHeaders.UserAgent.Add(new ProductInfoHeaderValue("hibp-downloader", FileVersionInfo.GetVersionInfo(process).ProductVersion));
}

#if NET7_0_OR_GREATER
client.DefaultRequestVersion = HttpVersion.Version30;
client.DefaultRequestVersion = HttpVersion.Version20;
client.DefaultVersionPolicy = HttpVersionPolicy.RequestVersionOrLower;
#endif
});
});

Expand Down

0 comments on commit 82b472c

Please sign in to comment.