Skip to content

Commit

Permalink
fix when container is not 8.x while creating sslcontext
Browse files Browse the repository at this point in the history
  • Loading branch information
osoykan committed Feb 15, 2023
1 parent b85ff95 commit af4d6ab
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ class ElasticsearchSystem internal constructor(
}

override suspend fun afterRun() {
esClient = createEsClient(exposedConfiguration, context.container.createSslContextFromCa())
esClient = createEsClient(exposedConfiguration)
context.options.migrationCollection.run(esClient)
}

Expand Down Expand Up @@ -216,10 +216,9 @@ class ElasticsearchSystem internal constructor(

private fun createEsClient(
exposedConfiguration: ElasticSearchExposedConfiguration,
sslContext: SSLContext,
): ElasticsearchClient =
context.options.clientConfigurer.restClientOverrideFn
.getOrElse { { cfg -> secureRestClient(cfg, sslContext) } }
.getOrElse { { cfg -> secureRestClient(cfg, context.container.createSslContextFromCa()) } }
.let { RestClientTransport(it(exposedConfiguration), JacksonJsonpMapper(jacksonObjectMapper())) }
.let { ElasticsearchClient(it) }

Expand Down

0 comments on commit af4d6ab

Please sign in to comment.