diff options
author | Wouter Tinus <wouter.tinus@gmail.com> | 2020-05-16 16:20:26 +0200 |
---|---|---|
committer | Wouter Tinus <wouter.tinus@gmail.com> | 2020-05-16 16:20:26 +0200 |
commit | c8859bb455fe3d0aa3a1010c36e72d9bbbe3e8d9 (patch) | |
tree | 870c6353f570e4f8137181fc829ea07565ea3118 | |
parent | c466f917b455763e920bee9d4a9b5e6a95935d81 (diff) | |
download | letsencrypt-win-simple-c8859bb455fe3d0aa3a1010c36e72d9bbbe3e8d9.zip letsencrypt-win-simple-c8859bb455fe3d0aa3a1010c36e72d9bbbe3e8d9.tar.gz letsencrypt-win-simple-c8859bb455fe3d0aa3a1010c36e72d9bbbe3e8d9.tar.bz2 |
show actual port number tried instead of hardcoded 80
-rw-r--r-- | src/main.lib/Plugins/ValidationPlugins/Http/SelfHosting/SelfHosting.cs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/main.lib/Plugins/ValidationPlugins/Http/SelfHosting/SelfHosting.cs b/src/main.lib/Plugins/ValidationPlugins/Http/SelfHosting/SelfHosting.cs index 2efacfa..6e165af 100644 --- a/src/main.lib/Plugins/ValidationPlugins/Http/SelfHosting/SelfHosting.cs +++ b/src/main.lib/Plugins/ValidationPlugins/Http/SelfHosting/SelfHosting.cs @@ -80,12 +80,13 @@ namespace PKISharp.WACS.Plugins.ValidationPlugins.Http public override Task PrepareChallenge() { _files.Add("/" + Challenge.HttpResourcePath, Challenge.HttpResourceValue); + var protocol = _options.Https == true ? "https" : "http"; + var port = _options.Port ?? (_options.Https == true ? + DefaultHttpsValidationPort : + DefaultHttpValidationPort); + var prefix = $"{protocol}://+:{port}/.well-known/acme-challenge/"; try { - var postfix = "/.well-known/acme-challenge/"; - var prefix = _options.Https == true ? - $"https://+:{_options.Port ?? DefaultHttpsValidationPort}{postfix}" : - $"http://+:{_options.Port ?? DefaultHttpValidationPort}{postfix}"; Listener = new HttpListener(); Listener.Prefixes.Add(prefix); Listener.Start(); @@ -93,7 +94,7 @@ namespace PKISharp.WACS.Plugins.ValidationPlugins.Http } catch { - _log.Error("Unable to activate HttpListener, this may be because of insufficient rights or a non-Microsoft webserver using port 80"); + _log.Error("Unable to activate listener, this may be because of insufficient rights or a non-Microsoft webserver using port {port}", port); throw; } return Task.CompletedTask; |