我已经按照下面的链接在jboss AS 7.1.2上设置HTTPS
http://middlewaremagic.com/jboss/?p=992
但是在此之后,当我启动jboss时,我收到以下错误:
10:31:05,481 ERROR [org.apache.coyote.http11.Http11AprProtocol]
↳ (MSC service thread 1-11) Error initializing endpoint: java.lang.Exception:
↳ Unable to load certificate key ../standalone/configuration/chap8.keystore
↳ (error:0906D06C:PEM routines:PEM_read_bio:no start line)
at org.apache.tomcat.jni.SSLContext.setCertificate(Native Method) [jbossweb-7.0.16.Final.jar:]
at org.apache.tomcat.util.net.AprEndpoint.init(AprEndpoint.java:644) [jbossweb-7.0.16.Final.jar:]
at org.apache.coyote.http11.Http11AprProtocol.init(Http11AprProtocol.java:121) [jbossweb-7.0.16.Final.jar:]
at org.apache.catalina.connector.Connector.init(Connector.java:983) [jbossweb-7.0.16.Final.jar:]
at org.jboss.as.web.WebConnectorService.start(WebConnectorService.java:267) [jboss-as-web-7.1.2.Final.jar:7.1.2.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_45]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_45]
at java.lang.Thread.run(Thread.java:744) [rt.jar:1.7.0_45]
10:31:05,489 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-11)
↳ MSC00001: Failed to start service jboss.web.connector.https:
↳ org.jboss.msc.service.StartException in service jboss.web.connector.https:
↳ JBAS018007: Error starting web connector
at org.jboss.as.web.WebConnectorService.start(WebConnectorService.java:271)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_45]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_45]
at java.lang.Thread.run(Thread.java:744) [rt.jar:1.7.0_45]
Caused by: LifecycleException: Protocol handler initialization failed: java.lang.Exception:
↳ Unable to load certificate key ../standalone/configuration/chap8.keystore
↳ (error:0906D06C:PEM routines:PEM_read_bio:no start line)
at org.apache.catalina.connector.Connector.init(Connector.java:985)
at org.jboss.as.web.WebConnectorService.start(WebConnectorService.java:267)
... 5 more
请帮我解决这个问题。
我收到上述错误,因为 JBoss 使用的是本机 APR 库。这个问题可以通过让 JBoss 使用 JSE 库而不是本机 APR 库来解决。
在子系统标记中使用 native="false" 来解决此问题。
这个问题是一年前添加的,但有人可能会发现这个答案很有帮助。您正在使用org.apache.coyote.http11.Http11AprProtocol协议,该协议使用本机OpenSSL。提供的证书(基于文件扩展名)是 JKS 密钥库。OpenSSL 无法读取此格式,因此会抛出error:0906D06C:PEM routines:PEM_read_bio:no start line
。为了解决这个问题,您必须将密钥库转换为符合OpenSSL的格式(crt,pem,key)或使用OpenSSL生成新密钥等。还存在一些配置差异。请参考这个 JBoss 文档。这适用于 Jboss AS 7.3.2,但据我所知,7.1.2 和 7.3.2 之间在这件事上没有区别。