声纳升级后HTTPS失败

时间:2016-06-10 06:25:01

标签: sonarqube sonarqube5.6

我刚刚从SonarQube 5.3升级到5.6。我从之前的 sonar.properties 中复制了我的键/值。 Sonar能够在HTTP上启动,但在尝试仅使用以前正在运行的HTTPS启动时会产生错误。

围绕HTTPS的我的sonar.properties:

sonar.web.port=-1
sonar.web.context=/sonar
sonar.web.https.port=9000
sonar.web.https.keyAlias=<confirmed alias>
sonar.web.https.keyPass=<confirmed password>
sonar.web.https.keystoreFile=<confirmed file>
sonar.web.https.keystoreType=JKS

使用上述配置生成的错误:

2016.06.10 02:05:46 INFO  web[o.s.p.ProcessEntryPoint] Starting web
2016.06.10 02:05:46 WARN  web[o.s.p.ProcessEntryPoint] Fail to start web
java.lang.IllegalStateException: HTTP connectors are disabled
        at org.sonar.server.app.TomcatConnectors.verify(TomcatConnectors.java:64) ~[sonar-server-5.6.jar:na]
        at org.sonar.server.app.TomcatConnectors.configure(TomcatConnectors.java:54) ~[sonar-server-5.6.jar:na]
        at org.sonar.server.app.EmbeddedTomcat.start(EmbeddedTomcat.java:59) ~[sonar-server-5.6.jar:na]
        at org.sonar.server.app.WebServer.start(WebServer.java:42) [sonar-server-5.6.jar:na]
        at org.sonar.process.ProcessEntryPoint.launch(ProcessEntryPoint.java:102) ~[sonar-process-5.6.jar:na]
        at org.sonar.server.app.WebServer.main(WebServer.java:68) [sonar-server-5.6.jar:na]

作为测试,我切换回HTTP:

sonar.web.port=9000
sonar.web.context=/sonar
#sonar.web.https.port=9000
sonar.web.https.keyAlias=<confirmed alias>
sonar.web.https.keyPass=<confirmed password>
sonar.web.https.keystoreFile=<confirmed file>
sonar.web.https.keystoreType=JKS

该日志中的信息:

2016.06.10 02:19:11 INFO  web[o.s.s.a.TomcatAccessLog] Web server is started
2016.06.10 02:19:11 INFO  web[o.s.s.a.EmbeddedTomcat] HTTP connector enabled on port 9000
2016.06.10 02:19:11 INFO  web[o.a.c.h.Http11NioProcessor] Error parsing HTTP request header
 Note: further occurrences of HTTP header parsing errors will be logged at DEBUG level.
java.lang.IllegalArgumentException: Invalid character (CR or LF) found in method name
        at org.apache.coyote.http11.AbstractNioInputBuffer.parseRequestLine(AbstractNioInputBuffer.java:228) ~[tomcat-embed-core-8.0.30.jar:8.0.30]
        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1010) ~[tomcat-embed-core-8.0.30.jar:8.0.30]
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:674) [tomcat-embed-core-8.0.30.jar:8.0.30]
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1500) [tomcat-embed-core-8.0.30.jar:8.0.30]
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1456) [tomcat-embed-core-8.0.30.jar:8.0.30]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_71]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_71]
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-8.0.30.jar:8.0.30]
        at java.lang.Thread.run(Thread.java:745) [na:1.8.0_71]

我错过了什么导致HTTPS不起作用?

1 个答案:

答案 0 :(得分:5)

在5.5版中删除了对HTTPS的支持。在conf / sonar.properties中,属性sonar.web.https。*不再存在。请参阅http://docs.sonarqube.org/display/SONAR/Release+5.5+Upgrade+Noteshttps://jira.sonarsource.com/browse/SONAR-7411。出于安全原因,应该使用反向代理。