Jenkins CLI with HTTPS
This works for me:
java -jar jenkins-cli.jar -noCertificateCheck -auth @jenkins_creds.txt -s https://jenkins.example.com help
(If I omit -auth
then I get an expected error about the need to authenticate to the Jenkins instance, but that doesn't seem relevant to you error.)
java-versionjava version "1.8.0_144"Java(TM) SE Runtime Environment (build 1.8.0_144-b01)Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)
Jenkins version: 2.138.3
I am wondering whether you have some other piece of equipment between your cli and your Jenkins server that cuts the connection if HTTPS cert verification fails.
I encountered the same problem on one of my jenkins slaves.Since the slaves were supposed to be identical, I started investigating the slightest differences between the machines.As it turns out, the java version was slightly different:
java-1.7.0-openjdk-1.7.0.75.x86_64 - On the working machine
java-1.7.0-openjdk-1.7.0.85.x86_64 - On the failing one.
I reverted back to the earlier openjdk version and the problem was fixed.Since you asked the question only a few days ago, I suspect we've encountered the same problem.
To check your version:
java -showversion -verbose 2>&1 | head -1
To install the previous openjdk version (on centos):
yum install java-1.7.0-openjdk-devel-1:1.7.0.75-2.5.4.0.el6_6.x86_64
If you are using a valid SSL cert. Checkout the jenkins-cli commands returning connect timed out
PS: This is not a solution but may be a workaround until a solution is found.