Skip to content

Commit

Permalink
Fixed Buypass Go SSL issuing error (#344)
Browse files Browse the repository at this point in the history
  • Loading branch information
shibayan authored Jul 30, 2021
1 parent 4c5b691 commit 10c8d7e
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion KeyVault.Acmebot/Functions/ISharedActivity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public interface ISharedActivity
Task<OrderDetails> FinalizeOrder((CertificatePolicyItem, OrderDetails) input);

[RetryOptions("00:00:05", 12, HandlerType = typeof(ExceptionRetryStrategy<RetriableActivityException>))]
Task CheckIsValid(OrderDetails orderDetails);
Task<OrderDetails> CheckIsValid(OrderDetails orderDetails);

Task<CertificateItem> MergeCertificate((string, OrderDetails) input);

Expand Down
6 changes: 3 additions & 3 deletions KeyVault.Acmebot/Functions/SharedActivity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ public async Task<OrderDetails> FinalizeOrder([ActivityTrigger] (CertificatePoli
}

[FunctionName(nameof(CheckIsValid))]
public async Task CheckIsValid([ActivityTrigger] OrderDetails orderDetails)
public async Task<OrderDetails> CheckIsValid([ActivityTrigger] OrderDetails orderDetails)
{
var acmeProtocolClient = await _acmeProtocolClientFactory.CreateClientAsync();

Expand All @@ -381,6 +381,8 @@ public async Task CheckIsValid([ActivityTrigger] OrderDetails orderDetails)
// invalid の場合は最初から実行が必要なので失敗させる
throw new InvalidOperationException("Finalize request is invalid. Required retry at first.");
}

return orderDetails;
}

[FunctionName(nameof(MergeCertificate))]
Expand All @@ -390,8 +392,6 @@ public async Task<CertificateItem> MergeCertificate([ActivityTrigger] (string, O

var acmeProtocolClient = await _acmeProtocolClientFactory.CreateClientAsync();

orderDetails = await acmeProtocolClient.GetOrderDetailsAsync(orderDetails.OrderUrl, orderDetails);

// 証明書をダウンロードして Key Vault へ格納
var x509Certificates = await acmeProtocolClient.GetOrderCertificateAsync(orderDetails, _options.PreferredChain);

Expand Down
2 changes: 1 addition & 1 deletion KeyVault.Acmebot/Functions/SharedOrchestrator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public async Task IssueCertificate([OrchestrationTrigger] IDurableOrchestrationC
if (orderDetails.Payload.Status != "valid")
{
// Finalize 後のステータスが valid になるまで 60 秒待機
await activity.CheckIsValid(orderDetails);
orderDetails = await activity.CheckIsValid(orderDetails);
}

// 証明書をダウンロードし Key Vault に保存
Expand Down
2 changes: 1 addition & 1 deletion KeyVault.Acmebot/static/add-certificate.html
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ <h1 class="title">
this.zones = response.data;
}
} catch (error) {
alert(error.response.data);
alert(error.response.data.output);
}

this.loading = false;
Expand Down
2 changes: 1 addition & 1 deletion KeyVault.Acmebot/static/renew-certificate.html
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ <h1 class="title">
this.certificates = response.data;
}
} catch (error) {
alert(error);
alert(error.response.data.output);
}

this.loading = false;
Expand Down

0 comments on commit 10c8d7e

Please sign in to comment.