Jenkins CLI with HTTPS

Now my Jenkins server has switched to HTTPS. However, now when you try to run jenkins-cli.jar, I get the following error:

Exception in thread "main" java.io.IOException: Failed to connect to https://ncs-jenkins.cisco.com/
    at hudson.cli.CLI.getCliTcpPort(CLI.java:266)
    at hudson.cli.CLI.<init>(CLI.java:126)
    at hudson.cli.CLIConnectionFactory.connect(CLIConnectionFactory.java:72)
    at hudson.cli.CLI._main(CLI.java:466)
    at hudson.cli.CLI.main(CLI.java:382)
Caused by: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
    at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:902)
    at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1208)
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1235)
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1219)
    at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:440)
    at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:153)
    at hudson.cli.CLI.getCliTcpPort(CLI.java:264)
    ... 4 more
Caused by: java.io.EOFException: SSL peer shut down incorrectly
    at sun.security.ssl.InputRecord.read(InputRecord.java:482)
    at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:883)
    ... 11 more

Is there a way to use Jenkins CLI through HTTPS?

This happens, for example, when I try to run even a help command:

java -jar jenkins-cli.jar -noCertificateCheck -s https://ncs-jenkins.cisco.com:8443/ -i /home/auto/.ssh/id_rsa help
+4
source share
2 answers

I faced the same problem with one of my Jenkins slaves. Since the slaves were supposed to be the same, I began to examine the slightest differences between the machines. As it turned out, the java version was slightly different:

java-1.7.0-openjdk-1.7.0.75.x86_64 - On a working machine

java-1.7.0-openjdk-1.7.0.85.x86_64 - In case of failure.

openjdk, . , , .

:

java -showversion -verbose 2>&1 | head -1

openjdk (on centos):

yum install java-1.7.0-openjdk-devel-1:1.7.0.75-2.5.4.0.el6_6.x86_64
0

SSL. jenkins-cli,

PS: , , .

0

All Articles