Skip to content

Commit 491d353

Browse files
committed
enable protocol choice, so we can enable https
1 parent 77acc09 commit 491d353

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

services/save-and-restore/src/main/java/org/phoebus/service/saveandrestore/persistence/config/ElasticConfig.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,9 @@ public class ElasticConfig {
9191
@Value("${elasticsearch.authorization.password}")
9292
private String password;
9393

94+
@Value("${elasticsearch.http.protocol:http}")
95+
private String protocol;
96+
9497

9598
private ElasticsearchClient client;
9699
private static final AtomicBoolean esInitialized = new AtomicBoolean();
@@ -112,7 +115,7 @@ public class ElasticConfig {
112115
public ElasticsearchClient getClient() {
113116
if (client == null) {
114117
// Create the low-level client
115-
RestClientBuilder clientBuilder = RestClient.builder(new HttpHost(host, port));
118+
RestClientBuilder clientBuilder = RestClient.builder(new HttpHost(host, port, protocol));
116119

117120
// Configure authentication
118121
if (!authorizationHeader.isEmpty()) {

services/save-and-restore/src/main/resources/application.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ server.port=8080
88
# Elasticsearch connection parameters
99
elasticsearch.network.host=localhost
1010
elasticsearch.http.port=9200
11+
elasticsearch.http.protocol=http
1112

1213
# The value for the `Authorization` header used in requests to the Elasticsearch server.
1314
# This header supports token-based or API key-based authentication.

0 commit comments

Comments
 (0)