From 2b18bc854b71535e71f463f234764d97171f18b0 Mon Sep 17 00:00:00 2001 From: Stuart Ferguson Date: Wed, 19 Jan 2022 13:56:27 +0000 Subject: [PATCH] Polling time increased and fixed failing HTTPS checks --- .../Startup.cs | 21 ++++++++++++++++++- .../appsettings.json | 4 ++-- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/TransactionProcessor.HealthChecksUI/TransactionProcessor.HealthChecksUI/Startup.cs b/TransactionProcessor.HealthChecksUI/TransactionProcessor.HealthChecksUI/Startup.cs index 5733b9b..51b8456 100644 --- a/TransactionProcessor.HealthChecksUI/TransactionProcessor.HealthChecksUI/Startup.cs +++ b/TransactionProcessor.HealthChecksUI/TransactionProcessor.HealthChecksUI/Startup.cs @@ -10,13 +10,32 @@ namespace TransactionProcessor.HealthChecksUI { + using System.Net.Http; + public class Startup { // This method gets called by the runtime. Use this method to add services to the container. // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940 public void ConfigureServices(IServiceCollection services) { - services.AddHealthChecksUI().AddInMemoryStorage(); + services.AddHealthChecksUI(settings => + { + settings.UseApiEndpointHttpMessageHandler(ApiEndpointHttpHandler); + }).AddInMemoryStorage(); + } + + private HttpClientHandler ApiEndpointHttpHandler(IServiceProvider arg) + { + return new HttpClientHandler + { + ServerCertificateCustomValidationCallback = (message, + cert, + chain, + errors) => + { + return true; + } + }; } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. diff --git a/TransactionProcessor.HealthChecksUI/TransactionProcessor.HealthChecksUI/appsettings.json b/TransactionProcessor.HealthChecksUI/TransactionProcessor.HealthChecksUI/appsettings.json index a9940a6..c861484 100644 --- a/TransactionProcessor.HealthChecksUI/TransactionProcessor.HealthChecksUI/appsettings.json +++ b/TransactionProcessor.HealthChecksUI/TransactionProcessor.HealthChecksUI/appsettings.json @@ -27,7 +27,7 @@ }, { "Name": "Estate Management UI", - "Uri": "http://192.168.0.133:5004/health" + "Uri": "https://192.168.0.133:5004/health" }, { "Name": "Estate Reporting Service", @@ -50,7 +50,7 @@ // "Uri": "http://192.168.0.133:5009/health" //} ], - "EvaluationTimeInSeconds": 10, + "EvaluationTimeInSeconds": 300, "MinimumSecondsBetweenFailureNotifications": 60 } }