Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.client.WebTarget;

import org.apache.cxf.transport.https.httpclient.DefaultHostnameVerifier;
import org.eclipse.microprofile.config.inject.ConfigProperty;
import org.talend.sdk.components.vault.configuration.Documentation;

Expand Down Expand Up @@ -190,15 +191,22 @@ private ClientBuilder createClient(final ExecutorService executor, final Optiona
final Optional<String> keystoreType, final String keystorePassword, final Optional<String> truststoreType,
final List<String> serverHostnames) {
final ClientBuilder builder = ClientBuilder.newBuilder();
final DefaultHostnameVerifier hostnameVerifier = new DefaultHostnameVerifier();
builder.connectTimeout(connectTimeout, MILLISECONDS);
builder.readTimeout(readTimeout, MILLISECONDS);
builder.executorService(executor);
if (acceptAnyCertificate) {
builder.hostnameVerifier((host, session) -> true);
builder.sslContext(createUnsafeSSLContext());
} else if (keystoreLocation.isPresent()) {
builder.hostnameVerifier((host, session) -> serverHostnames.contains(host));
builder.sslContext(createSSLContext(keystoreLocation, keystoreType, keystorePassword, truststoreType));
} else {
if (keystoreLocation.isPresent()) {
builder.hostnameVerifier(hostnameVerifier);
builder.sslContext(createSSLContext(keystoreLocation, keystoreType, keystorePassword, truststoreType));
} else {
log.info("TCK vault-client doesn't explicitly define the keystore location. Please configure " +
Copy link
Member

@undx undx Jan 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't a warning more relevant?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so. I think if properties are not set it uses default java configuration. The two properties seem to be use to specify its own keystore.

"'talend.vault.cache.client.vault.certificate.keystore.location' and " +
"'talend.vault.cache.client.vault.certificate.keystore.type' to define it explicitly.");
}
}
providers.map(it -> Stream.of(it.split(",")).map(String::trim).filter(v -> !v.isEmpty()).map(fqn -> {
try {
Expand Down
Loading