运维开发网

在jenkins中启用HTTPS?

运维开发网 https://www.qedev.com 2020-05-09 12:55 出处:网络 作者:运维开发网整理
我有一个带有本地IP的专用网络. 我想为我的Jenkins服务器启用HTTPS,这是静态IP W.X.Y.Z:8080. Jenkins version 2.9 java version "1.7.0_111" OpenJDK Runtime Environment (IcedTea 2.6.7) (7u111-2.6.7-0ubuntu0.14.04.3) OpenJDK 64-Bit Serv
我有一个带有本地IP的专用网络.

我想为我的Jenkins服务器启用HTTPS,这是静态IP W.X.Y.Z:8080.

Jenkins version 2.9
java version "1.7.0_111"
OpenJDK Runtime Environment (IcedTea 2.6.7) (7u111-2.6.7-0ubuntu0.14.04.3)
OpenJDK 64-Bit Server VM (build 24.111-b01, mixed mode)

我尝试在/ etc / defaults / jenkins文件中配置以下参数

HTTP_PORT=-1
JENKINS_ARGS="--webroot=/var/cache/$NAME/war -DsessionTimeout=1 --httpPort=$HTTP_PORT  --httpsPort=8081"

但我得到以下错误.请帮忙

Running from: /usr/share/jenkins/jenkins.war
webroot: $user.home/.jenkins
Oct 19, 2016 2:18:48 PM org.eclipse.jetty.util.log.JavaUtilLog info
INFO: Logging initialized @811ms
Oct 19, 2016 2:18:48 PM winstone.Logger logInternal
INFO: Beginning extraction from war file
Oct 19, 2016 2:18:48 PM org.eclipse.jetty.util.log.JavaUtilLog warn
WARNING: Empty contextPath
Using one-time self-signed certificate
Oct 19, 2016 2:18:48 PM winstone.Logger logInternal
INFO: Winstone shutdown successfully
Oct 19, 2016 2:18:48 PM winstone.Logger logInternal
SEVERE: Container startup failed
java.io.IOException: Failed to start a listener
winstone.HttpsConnectorFactory
at winstone.Launcher.spawnListener(Launcher.java:207)
at winstone.Launcher.<init>(Launcher.java:149)
at winstone.Launcher.main(Launcher.java:352)`enter code here`
at sun.reflect.NativeMethodAccessorImpl.invoke0

我发现这里解决了类似的问题,但它对我不起作用

EDIT1:

在/ etc / defaults / jenkins文件中尝试了以下更改并重新启动了jenkins,但它对我不起作用.

HTTP_PORT=-1
JENKINS_ARGS="--webroot=/var/cache/$NAME/war -DsessionTimeout=1 --httpPort=$HTTP_PORT   --httpsPort=8443 --httpsCertificate=cert.pem --httpsPrivateKey=key.pem

https://issues.jenkins-ci.org/browse/JENKINS-34463

https://issues.jenkins-ci.org/browse/JENKINS-25333

您需要传递私钥的密钥库或.pem文件的参数

https://wiki.jenkins-ci.org/display/JENKINS/Starting+and+Accessing+Jenkins

0

精彩评论

暂无评论...
验证码 换一张
取 消