diff options
author | Wouter Tinus <win.acme.simple@gmail.com> | 2020-03-01 13:22:35 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-01 13:22:35 +0100 |
commit | c76a096f30c702aee7cadfd179421641f2a5fe4a (patch) | |
tree | 45fd536f35f098430985498d8316ad0a2c94c85b /src/main.lib/Services/RenewalStoreDisk.cs | |
parent | 2c3e6d331e2a071e34103b28dbaaf6ea7c767b36 (diff) | |
parent | 6acf0d45482324a919edf9404776736dfc782ed5 (diff) | |
download | letsencrypt-win-simple-2.1.5.zip letsencrypt-win-simple-2.1.5.tar.gz letsencrypt-win-simple-2.1.5.tar.bz2 |
Merge pull request #1429 from win-acme/2.1.5v2.1.5
2.1.5
Diffstat (limited to 'src/main.lib/Services/RenewalStoreDisk.cs')
-rw-r--r-- | src/main.lib/Services/RenewalStoreDisk.cs | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/src/main.lib/Services/RenewalStoreDisk.cs b/src/main.lib/Services/RenewalStoreDisk.cs index ce1d6e9..1931f63 100644 --- a/src/main.lib/Services/RenewalStoreDisk.cs +++ b/src/main.lib/Services/RenewalStoreDisk.cs @@ -34,20 +34,25 @@ namespace PKISharp.WACS.Services var list = new List<Renewal>(); var di = new DirectoryInfo(_settings.Client.ConfigurationPath); var postFix = ".renewal.json"; - foreach (var rj in di.GetFiles($"*{postFix}", SearchOption.AllDirectories)) + foreach (var rj in di.EnumerateFiles($"*{postFix}", SearchOption.AllDirectories)) { try { var storeConverter = new PluginOptionsConverter<StorePluginOptions>(_plugin.PluginOptionTypes<StorePluginOptions>(), _log); var result = JsonConvert.DeserializeObject<Renewal>( File.ReadAllText(rj.FullName), - new ProtectedStringConverter(_log, _settings), - new StorePluginOptionsConverter(storeConverter), - new PluginOptionsConverter<TargetPluginOptions>(_plugin.PluginOptionTypes<TargetPluginOptions>(), _log), - new PluginOptionsConverter<CsrPluginOptions>(_plugin.PluginOptionTypes<CsrPluginOptions>(), _log), - storeConverter, - new PluginOptionsConverter<ValidationPluginOptions>(_plugin.PluginOptionTypes<ValidationPluginOptions>(), _log), - new PluginOptionsConverter<InstallationPluginOptions>(_plugin.PluginOptionTypes<InstallationPluginOptions>(), _log)); + new JsonSerializerSettings() { + ObjectCreationHandling = ObjectCreationHandling.Replace, + Converters = { + new ProtectedStringConverter(_log, _settings), + new StorePluginOptionsConverter(storeConverter), + new PluginOptionsConverter<TargetPluginOptions>(_plugin.PluginOptionTypes<TargetPluginOptions>(), _log), + new PluginOptionsConverter<CsrPluginOptions>(_plugin.PluginOptionTypes<CsrPluginOptions>(), _log), + storeConverter, + new PluginOptionsConverter<ValidationPluginOptions>(_plugin.PluginOptionTypes<ValidationPluginOptions>(), _log), + new PluginOptionsConverter<InstallationPluginOptions>(_plugin.PluginOptionTypes<InstallationPluginOptions>(), _log) + } + }); if (result == null) { throw new Exception("result is empty"); |