diff --git a/CHANGELOG.md b/CHANGELOG.md index 1227ce2..58c5574 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +v1.1.2 +- Fix Renewal bug referencing the wrong REST Resource V1 + v1.1.1 - Fix Revoke Serial Number Mismatch KF 10.1 and 22.1.0 GW combination - Only Syncing and GetSingleRecord on End Entity Cert to prevent errors. diff --git a/CscGlobalCaProxy/Client/CscGlobalClient.cs b/CscGlobalCaProxy/Client/CscGlobalClient.cs index 962460f..291f98c 100644 --- a/CscGlobalCaProxy/Client/CscGlobalClient.cs +++ b/CscGlobalCaProxy/Client/CscGlobalClient.cs @@ -59,7 +59,7 @@ public async Task SubmitRegistrationAsync( public async Task SubmitRenewalAsync( RenewalRequest renewalRequest) { - using (var resp = await RestClient.PostAsync("/tls/renewal", new StringContent( + using (var resp = await RestClient.PostAsync("/dbs/api/v2/tls/renewal", new StringContent( JsonConvert.SerializeObject(renewalRequest), Encoding.ASCII, "application/json"))) { Logger.Trace(JsonConvert.SerializeObject(renewalRequest)); @@ -67,17 +67,22 @@ public async Task SubmitRenewalAsync( var settings = new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore }; if (resp.StatusCode == HttpStatusCode.BadRequest) //Csc Sends Errors back in 400 Json Response { + var rawErrorResponse = await resp.Content.ReadAsStringAsync(); + Logger.Trace("Logging Error Response Raw"); + Logger.Trace(rawErrorResponse); var errorResponse = - JsonConvert.DeserializeObject(await resp.Content.ReadAsStringAsync(), + JsonConvert.DeserializeObject(rawErrorResponse, settings); var response = new RenewalResponse(); response.RegistrationError = errorResponse; response.Result = null; return response; } - + var rawRenewResponse = await resp.Content.ReadAsStringAsync(); + Logger.Trace("Logging Success Response Raw"); + Logger.Trace(rawRenewResponse); var renewalResponse = - JsonConvert.DeserializeObject(await resp.Content.ReadAsStringAsync()); + JsonConvert.DeserializeObject(rawRenewResponse); return renewalResponse; } } diff --git a/CscGlobalCaProxy/RequestManager.cs b/CscGlobalCaProxy/RequestManager.cs index 31b0231..ff04bab 100644 --- a/CscGlobalCaProxy/RequestManager.cs +++ b/CscGlobalCaProxy/RequestManager.cs @@ -24,14 +24,14 @@ public EnrollmentResult GetRenewResponse(RenewalResponse renewResponse) return new EnrollmentResult { Status = 30, //failure - CARequestID = renewResponse.Result.Status.Uuid, + CARequestID = renewResponse?.Result?.Status?.Uuid, StatusMessage = renewResponse.RegistrationError.Description }; return new EnrollmentResult { Status = 13, //success - + CARequestID = renewResponse?.Result?.Status?.Uuid, StatusMessage = $"Renewal Successfully Completed For {renewResponse.Result.CommonName}" }; } diff --git a/README.md b/README.md index a8f4aef..9f9c99c 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ This gateway extension was compiled against version of the AnyCA Gateway DCOM F *** # Getting Started ## Standard Gateway Installation -To begin, you must have the CA Gateway Service 21.3.2 installed and operational before attempting to configure the CSC Global plugin. This integration was tested with Keyfactor 8.7.0.0. +To begin, you must have the CA Gateway Service 22.1.0 installed and operational before attempting to configure the CSC Global plugin. This integration was tested with Keyfactor 10.4.0.0. To install the gateway follow these instructions. 1) Gateway Server - run the installation .msi - Get from Keyfactor diff --git a/readme_source.md b/readme_source.md index 9df82a1..36f31f3 100644 --- a/readme_source.md +++ b/readme_source.md @@ -1,7 +1,7 @@ *** # Getting Started ## Standard Gateway Installation -To begin, you must have the CA Gateway Service 21.3.2 installed and operational before attempting to configure the CSC Global plugin. This integration was tested with Keyfactor 8.7.0.0. +To begin, you must have the CA Gateway Service 22.1.0 installed and operational before attempting to configure the CSC Global plugin. This integration was tested with Keyfactor 10.4.0.0. To install the gateway follow these instructions. 1) Gateway Server - run the installation .msi - Get from Keyfactor