@@ -282,10 +282,27 @@ private static void ConfigureEventStoreSettings(EventStoreClientSettings setting
282282 Insecure = Startup . Configuration . GetValue < Boolean > ( "EventStoreSettings:Insecure" ) ,
283283 Address = new Uri ( Startup . Configuration . GetValue < String > ( "EventStoreSettings:ConnectionString" ) ) ,
284284 } ;
285-
285+
286+ settings . DefaultCredentials = new UserCredentials ( Startup . Configuration . GetValue < String > ( "EventStoreSettings:UserName" ) ,
287+ Startup . Configuration . GetValue < String > ( "EventStoreSettings:Password" ) ) ;
288+
286289 Startup . EventStoreClientSettings = settings ;
287290 }
288291
292+ private HttpClientHandler ApiEndpointHttpHandler ( IServiceProvider serviceProvider )
293+ {
294+ return new HttpClientHandler
295+ {
296+ ServerCertificateCustomValidationCallback = ( message ,
297+ cert ,
298+ chain ,
299+ errors ) =>
300+ {
301+ return true ;
302+ }
303+ } ;
304+ }
305+
289306 /// <summary>
290307 /// Configures the middleware services.
291308 /// </summary>
@@ -298,16 +315,8 @@ private void ConfigureMiddlewareServices(IServiceCollection services)
298315 name : "Eventstore" ,
299316 failureStatus : HealthStatus . Unhealthy ,
300317 tags : new string [ ] { "db" , "eventstore" } )
301- . AddUrlGroup ( new Uri ( $ "{ ConfigurationReader . GetValue ( "SecurityConfiguration" , "Authority" ) } /health") ,
302- name : "Security Service" ,
303- httpMethod : HttpMethod . Get ,
304- failureStatus : HealthStatus . Unhealthy ,
305- tags : new string [ ] { "security" , "authorisation" } )
306- . AddUrlGroup ( new Uri ( $ "{ ConfigurationReader . GetValue ( "AppSettings" , "EstateManagementApi" ) } /health") ,
307- name : "Estate Management Service" ,
308- httpMethod : HttpMethod . Get ,
309- failureStatus : HealthStatus . Unhealthy ,
310- tags : new string [ ] { "application" , "estatemanagement" } ) ;
318+ . AddSecurityService ( this . ApiEndpointHttpHandler )
319+ . AddEstateManagementService ( ) ;
311320
312321 services . AddSwaggerGen ( c =>
313322 {
0 commit comments