fix(docker): pass the resolved TLS config to the Docker HTTP client (#4638)

* fix(docker): pass the resolved TLS config to the Docker HTTP client

The client config carried TLS material from DOCKER_TLS_VERIFY/DOCKER_CERT_PATH or the active context, but the ApacheDockerHttpClient was built without it, so TLS daemons were spoken to in plain HTTP. The HTTP client is now built in a package-private newHttpClient that passes clientConfig.getSSLConfig(); a TLS-verify config with unreadable certificates now fails the build, which the test uses to observe that the SSL config is actually consumed.

Fixes #4608

* test(docker): use explicit types and imports in the TLS client tests
This commit is contained in:
Sam Fakhreddine authored and GitHub committed 2026-10-04 20:45:20 -05:00
1 parent b2e3870c06
commit 728e000187
2 files changed
+42 -3

No files matched your search

@@ -489,14 +489,18 @@ public class DockerClientProducer {
LOG.infov("Creating {0} DockerClient pool (maxConnections={1}) for host: {2}",
role, maxConnections, clientConfig.getDockerHost());
ApacheDockerHttpClient httpClient = new ApacheDockerHttpClient.Builder()
return DockerClientImpl.getInstance(clientConfig,
wrapForRole(newHttpClient(clientConfig, maxConnections), role));
}
static ApacheDockerHttpClient newHttpClient(DefaultDockerClientConfig clientConfig, int maxConnections) {
return new ApacheDockerHttpClient.Builder()
.dockerHost(clientConfig.getDockerHost())
.sslConfig(clientConfig.getSSLConfig())
.maxConnections(maxConnections)
.connectionTimeout(Duration.ofSeconds(30))
.responseTimeout(Duration.ofMinutes(5))
.build();
return DockerClientImpl.getInstance(clientConfig, wrapForRole(httpClient, role));
}
/**