|
@@ -19,7 +19,6 @@ using GenHTTP.Modules.IO;
|
|
|
using GenHTTP.Modules.Practices;
|
|
|
using InABox.Core;
|
|
|
using Microsoft.VisualBasic;
|
|
|
-using Newtonsoft.Json;
|
|
|
using PRSServices;
|
|
|
using Timer = System.Timers.Timer;
|
|
|
|
|
@@ -151,7 +150,7 @@ public class CertificateEngine : Engine<CertificateEngineProperties>
|
|
|
|
|
|
if (typeof(T) == typeof(byte[])) return (T)(object)File.ReadAllBytes(path);
|
|
|
|
|
|
- return JsonConvert.DeserializeObject<T>(File.ReadAllText(path)) ?? default;
|
|
|
+ return Serialization.Deserialize<T>(File.ReadAllText(path)) ?? default;
|
|
|
}
|
|
|
|
|
|
protected static void Save<T>(string path, T value)
|
|
@@ -171,8 +170,7 @@ public class CertificateEngine : Engine<CertificateEngineProperties>
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- File.WriteAllText(path,
|
|
|
- JsonConvert.SerializeObject(value, Formatting.Indented));
|
|
|
+ File.WriteAllText(path, Serialization.Serialize(value, true));
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -352,7 +350,7 @@ public class CertificateEngine : Engine<CertificateEngineProperties>
|
|
|
if (Order?.Payload?.Error != null)
|
|
|
{
|
|
|
Logger.Send(LogType.Information, "", "Existing Order reported an Error:");
|
|
|
- Logger.Send(LogType.Information, "", JsonConvert.SerializeObject(Order.Payload.Error));
|
|
|
+ Logger.Send(LogType.Information, "", Serialization.Serialize(Order.Payload.Error));
|
|
|
Logger.Send(LogType.Information, "", "Resetting existing order");
|
|
|
Order = null;
|
|
|
}
|
|
@@ -408,12 +406,12 @@ public class CertificateEngine : Engine<CertificateEngineProperties>
|
|
|
if (Handler.AddChallengeHandling(chlngValidation))
|
|
|
{
|
|
|
Logger.Send(LogType.Information, "", "Challenge Handler has handled challenge:");
|
|
|
- Logger.Send(LogType.Information, "", JsonConvert.SerializeObject(chlngValidation, Formatting.Indented));
|
|
|
+ Logger.Send(LogType.Information, "", Serialization.Serialize(chlngValidation, true));
|
|
|
var chlngUpdated = await acme.AnswerChallengeAsync(chlng.Url);
|
|
|
if (chlngUpdated.Error != null)
|
|
|
{
|
|
|
Logger.Send(LogType.Error, "", "Submitting Challenge Answer reported an error:");
|
|
|
- Logger.Send(LogType.Error, "", JsonConvert.SerializeObject(chlngUpdated.Error));
|
|
|
+ Logger.Send(LogType.Error, "", Serialization.Serialize(chlngUpdated.Error));
|
|
|
}
|
|
|
}
|
|
|
|