我刚刚完成了从 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 不起作用?