summaryrefslogtreecommitdiffstats
path: root/src/main.lib/Services/ProxyService.cs
diff options
context:
space:
mode:
authorWouter Tinus <win.acme.simple@gmail.com>2020-10-02 06:04:59 +0200
committerGitHub <noreply@github.com>2020-10-02 06:04:59 +0200
commit160ed1ad546b1a71d0d2a1557073b40983964bfe (patch)
tree1e8a1afd3ee2e75c6ee5e10306fc6df1696b1470 /src/main.lib/Services/ProxyService.cs
parentc662521de225e4dd4078fc6f0c2d1adfe323e368 (diff)
parentf0390cc9d8d8ffe82c4641f1e09e06d1ca9e12ae (diff)
downloadletsencrypt-win-simple-160ed1ad546b1a71d0d2a1557073b40983964bfe.zip
letsencrypt-win-simple-160ed1ad546b1a71d0d2a1557073b40983964bfe.tar.gz
letsencrypt-win-simple-160ed1ad546b1a71d0d2a1557073b40983964bfe.tar.bz2
Merge pull request #1672 from win-acme/2.1.11v2.1.11
2.1.11
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