使用HTTPS的Jenkins CLI [英] Jenkins CLI with HTTPS

查看:172
本文介绍了使用HTTPS的Jenkins CLI的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的Jenkins服务器现已使用HTTPS切换到现在。但是,现在在尝试运行jenkins-cli.jar时,我收到以下错误:

My Jenkins server was switched to now using HTTPS. However, now when trying 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

有没有办法通过HTTPS使用Jenkins CLI?

Is there any way to use Jenkins CLI over HTTPS?

这种情况发生了,例如当我尝试运行甚至只是帮助命令时:

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

java -jar jenkins-cli.jar -noCertificateCheck -s https://ncs-jenkins.cisco.com:8443/ -i /home/auto/.ssh/id_rsa help


推荐答案

如果您使用的是有效的SSL证书。
查看 jenkins-cli命令返回连接超时

If you are using a valid SSL cert. Checkout the jenkins-cli commands returning connect timed out

PS:这不是解决方案,但在找到解决方案之前可能是一种解决方法。

PS: This is not a solution but may be a workaround until a solution is found.

这篇关于使用HTTPS的Jenkins CLI的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆