Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions Models/AcmeChallenge.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
namespace KCert.Models;
using System.Text.Json.Nodes;

namespace KCert.Models;

public class AcmeChallenge
{
public string Url { get; set; } = default!;
public string Type { get; set; } = default!;
public string Status { get; set; } = default!;
public string Token { get; set; } = default!;
public string Validated { get; set; } = default!;
public required string Url { get; init; }
public required string Type { get; init; }
public required string Status { get; init; }
public required string Token { get; init; }
public required string Validated { get; init; }

public JsonObject? Error { get; init; }
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could be wrong, but I'm thinking this is an impossible scenario to reach. If there are errors, won't the _http.PostAsync() call throw an exception?

}
18 changes: 11 additions & 7 deletions Models/AcmeOrderResponse.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
namespace KCert.Models;
using System.Text.Json.Nodes;

namespace KCert.Models;

public class AcmeOrderResponse : AcmeResponse
{
public string Status { get; set; } = default!;
public string Expires { get; set; } = default!;
public AcmeIdentifier[] Identifiers { get; set; } = default!;
public string[] Authorizations { get; set; } = default!;
public string Finalize { get; set; } = default!;
public string Certificate { get; set; } = default!;
public required string Status { get; init; }
public required string Expires { get; init; }
public AcmeIdentifier[] Identifiers { get; init; }
public required string[] Authorizations { get; init; }
public required string Finalize { get; init; }
public required string Certificate { get; init; }

public JsonObject? Error { get; init; }
}
10 changes: 9 additions & 1 deletion Services/RenewalHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,15 @@ private async Task<string> ValidateAuthorizationAsync(string key, string kid, st
{
await Task.Delay(waitTime);
finalize = await acme.GetOrderAsync(key, orderUri, kid, finalize.Nonce);
logbuf.LogInformation("Check Order {orderUri}: {finalize.Status}", orderUri, finalize.Status);

if (finalize.Error is { } error)
{
logbuf.LogWarning("Check Order {orderUri}: {finalize.Status}\nError: {error}", orderUri, finalize.Status, error);
}
else
{
logbuf.LogInformation("Check Order {orderUri}: {finalize.Status}", orderUri, finalize.Status);
}
}

if (finalize.Status != "valid")
Expand Down