What I've done
I use Jenkins as a Docker container. I'm setting up a Jenkins Cloud Agent using the Docker Remote API with Socat and TLS.
I followed these steps:
- Created a Certificate Authority (CA) on the Socat server.
- Generated server and client certificates (with Subject Alternative Name configured).
- Started Socat container with the following command:
OPENSSL-LISTEN:2370,reuseaddr,cert=/etc/docker/certs/server-cert.pem,key=/etc/docker/certs/server-key.pem,cafile=/etc/docker/certs/ca.pem,fork UNIX-CONNECT:/var/run/docker.sock
Configured Jenkins:
- Set ip:port as the Docker host.
- Added the client key, client certificate, and CA certificate to Jenkins credentials.
- The "Test Connection" succeeds.
The issue
When I start a Jenkins job using the Jenkins Cloud Agent just created, the following logs occur:
Error in provisioning; template='DockerTemplate{configVersion=2, labelString='prod-cloud-agent-dind', connector=DockerComputerAttachConnector{}, instanceCap=2147483647, mode=EXCLUSIVE, retentionStrategy=com.nirima.jenkins.plugins.docker.strategy.DockerOnceRetentionStrategy@29, dockerTemplateBase=DockerTemplateBase{image='localhost:5000/cloudagent-dind:20.10.17', mounts=[type=bind,src=/var/run/docker.sock,target=/var/run/docker.sock, type=bind,src=ecc.,target=ecc., type=bind,src=ecc.,target=ecc.], bindAllPorts=false, cpuPeriod=0, cpuQuota=0, privileged=false, tty=false}, removeVolumes=false, stopTimeout=10, pullStrategy=PULL_ALWAYS, pullTimeout=300, disabled=BySystem,0 ms,4 min 59 sec,Template provisioning failed., name='Prod Cloud Agent Docker in Docker'}' for cloud='prod-dind'
javax.ssl.SSLException: Received fatal alert: internal_error
at java.base/sun.security.ssl.Alert.createSSLException(Unknown Source)
at java.base/sun.security.ssl.Alert.createSSLException(Unknown Source)
...
javax.ssl.SSLException: Received fatal alert: internal_error
at java.base/sun.security.ssl.Alert.createSSLException(Unknown Source)
at java.base/sun.security.ssl.Alert.createSSLException(Unknown Source)
...