Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fix shared-param-file default value in configurations, and fix deprecated code #56

Merged
merged 2 commits into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docker/lister/config/application-fi.sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ springdoc:

# X-Road instance parameters
xroad-catalog:
shared-params-file: /etc/xroad/globalconf/DEV/shared-params.xml
shared-params-file: ${xroad.common.configuration-path}/<INSTANCE_IDENTIFIER>/shared-params.xml
country:
fi:
enabled: true
Expand Down
2 changes: 1 addition & 1 deletion docker/lister/config/application-production.sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ springdoc:

# X-Road instance parameters
xroad-catalog:
shared-params-file: /etc/xroad/globalconf/DEV/shared-params.xml
shared-params-file: ${xroad.common.configuration-path}/<INSTANCE_IDENTIFIER>/shared-params.xml
country:
fi:
enabled: false
Expand Down
2 changes: 1 addition & 1 deletion docker/lister/config/application.sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ xroad:

# X-Road instance parameters
xroad-catalog:
shared-params-file: ${common.configuration-path}/DEV/shared-params.xml
shared-params-file: ${xroad.common.configuration-path}/<INSTANCE_IDENTIFIER>/shared-params.xml
country.fi.enabled: true
configuration-client.enabled: true

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
import org.apache.hc.client5.http.impl.classic.HttpClients;
import org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager;
import org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManagerBuilder;
import org.apache.hc.client5.http.ssl.DefaultClientTlsStrategy;
import org.apache.hc.client5.http.ssl.NoopHostnameVerifier;
import org.apache.hc.client5.http.ssl.SSLConnectionSocketFactory;
import org.apache.hc.core5.ssl.SSLContexts;
import org.apache.hc.core5.ssl.TrustStrategy;
import org.json.JSONArray;
Expand Down Expand Up @@ -610,18 +610,16 @@ public boolean isTrusted(X509Certificate[] x509Certificates, String s)
SSLContext sslContext = SSLContexts.custom()
.loadTrustMaterial(null, acceptingTrustStrategy)
.build();
SSLConnectionSocketFactory csf = new SSLConnectionSocketFactory(sslContext,
new NoopHostnameVerifier());
DefaultClientTlsStrategy defaultClientTlsStrategy = new DefaultClientTlsStrategy(sslContext, new NoopHostnameVerifier());
PoolingHttpClientConnectionManager cm = PoolingHttpClientConnectionManagerBuilder
.create()
.setSSLSocketFactory(csf)
.setTlsSocketStrategy(defaultClientTlsStrategy)
.build();
CloseableHttpClient httpClient = HttpClients.custom().setConnectionManager(cm).build();
HttpComponentsClientHttpRequestFactory requestFactory = new HttpComponentsClientHttpRequestFactory();
requestFactory.setHttpClient(httpClient);
RestTemplate restTemplate = new RestTemplate(requestFactory);

return restTemplate;
return new RestTemplate(requestFactory);
} catch (NoSuchAlgorithmException | KeyStoreException | KeyManagementException e) {
log.error("Error creating REST client for Company and Organization services", e);
return null;
Expand Down
6 changes: 3 additions & 3 deletions xroad-catalog-lister/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ Configurations are categorized according to their usage into different groups in

#### Mandatory Configurations for Common Features

| Parameter | Defaults | Description | Since |
|------------------------------------|----------------------------------------------------------------------|--------------------------------------------------------------------------------------|-------|
| `xroad-catalog.shared-params-file` | ${common.configuration-path}/<INSTANCE_IDENTIFIER>/shared-params.xml | A parameter for setting the path to shared params file exported from X-Road server. | 1.0.0 |
| Parameter | Defaults | Description | Since |
|------------------------------------|----------------------------------------------------------------------------|--------------------------------------------------------------------------------------|-------|
| `xroad-catalog.shared-params-file` | ${xroad.common.configuration-path}/<INSTANCE_IDENTIFIER>/shared-params.xml | A parameter for setting the path to shared params file exported from X-Road server. | 1.0.0 |

### Optional Configurations

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ spring:

# X-Road instance parameters
xroad-catalog:
shared-params-file: ${xroad.conf.path}globalconf/DEV/shared-params.xml
shared-params-file: ${xroad.common.configuration-path}/DEV/shared-params.xml
country:
fi:
enabled: true
Expand Down
2 changes: 1 addition & 1 deletion xroad-catalog-lister/src/main/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ xroad:

# X-Road instance parameters
xroad-catalog:
shared-params-file: ${common.configuration-path}/<INSTANCE_IDENTIFIER>/shared-params.xml
shared-params-file: ${xroad.common.configuration-path}/<INSTANCE_IDENTIFIER>/shared-params.xml
country.fi.enabled: false
configuration-client.enabled: true

Expand Down
Loading