summaryrefslogtreecommitdiffstats
path: root/src/main.lib/Services/ProxyService.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.lib/Services/ProxyService.cs')
-rw-r--r--src/main.lib/Services/ProxyService.cs8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/main.lib/Services/ProxyService.cs b/src/main.lib/Services/ProxyService.cs
index 17e45fd..6294835 100644
--- a/src/main.lib/Services/ProxyService.cs
+++ b/src/main.lib/Services/ProxyService.cs
@@ -12,12 +12,14 @@ namespace PKISharp.WACS.Services
private readonly ILogService _log;
private IWebProxy? _proxy;
private readonly ISettingsService _settings;
+ private readonly VersionService _version;
public SslProtocols SslProtocols { get; set; } = SslProtocols.None;
- public ProxyService(ILogService log, ISettingsService settings)
+ public ProxyService(ILogService log, ISettingsService settings, VersionService version)
{
_log = log;
_settings = settings;
+ _version = version;
}
/// <summary>
@@ -44,7 +46,9 @@ namespace PKISharp.WACS.Services
{
httpClientHandler.DefaultProxyCredentials = CredentialCache.DefaultCredentials;
}
- return new HttpClient(httpClientHandler);
+ var httpClient = new HttpClient(httpClientHandler);
+ httpClient.DefaultRequestHeaders.Add("User-Agent", $"win-acme/{_version.SoftwareVersion} (+https://github.com/win-acme/win-acme)");
+ return httpClient;
}
private class LoggingHttpClientHandler : HttpClientHandler