JBOSS应用程序SSL错误:别名不标识密钥条目

时间:2013-07-11 08:07:15

标签: openssl ssl-certificate jboss6.x keytool

我正在尝试使用SSL并使用提供给我的证书来配置JBOSS应用程序6.0.1(通过委托)。

我从.CER格式的Entrust获得了三个证书(root,chain& server证书)。

接下来我创建了一个密钥库:

1.keytool -import -alias EntrustL1C -keystore EntrustL1C.mykeystore -trustcacerts -file L1Cchain.cer 输入密钥库密码: 重新输入新的密码: 证书已添加到密钥库

2.keytool -import -alias Root -keystore EntrustL1C.mykeystore -trustcacerts -file L1Croot.cer 输入密钥库密码:

3.#keytool -import -alias myalias -keystore EntrustL1C.mykeystore -trustcacerts -file entrustcert.cer 输入密钥库密码: 证书已添加到密钥库

我在两个SSL部分的JBOSS的standalone.xml中配置了它:

                                    

启动JBOSS应用程序时出现此错误。

13:08:23,311 ERROR [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-3) Error initializing endpoint: java.io.IOException: Alias name test does not 
identify a key entry
        at org.apache.tomcat.util.net.jsse.JSSESocketFactory.getKeyManagers(JSSESocketFactory.java:517) [jbossweb-7.0.17.Final-redhat-1.jar:]
        at org.apache.tomcat.util.net.jsse.JSSESocketFactory.init(JSSESocketFactory.java:452) [jbossweb-7.0.17.Final-redhat-1.jar:]
        at org.apache.tomcat.util.net.jsse.JSSESocketFactory.createSocket(JSSESocketFactory.java:168) [jbossweb-7.0.17.Final-redhat-1.jar:]
        at org.apache.tomcat.util.net.JIoEndpoint.init(JIoEndpoint.java:978) [jbossweb-7.0.17.Final-redhat-1.jar:]
        at org.apache.coyote.http11.Http11Protocol.init(Http11Protocol.java:190) [jbossweb-7.0.17.Final-redhat-1.jar:]
        at org.apache.catalina.connector.Connector.init(Connector.java:1001) [jbossweb-7.0.17.Final-redhat-1.jar:]
        at org.jboss.as.web.WebConnectorService.start(WebConnectorService.java:268) [jboss-as-web-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4]
        at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA-redhat-2.jar:1.0.2.GA-redhat-2]
        at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA-redhat-2.jar:1.0.2.GA-redhat-2]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.6.0_22]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.6.0_22]
        at java.lang.Thread.run(Thread.java:679) [rt.jar:1.6.0_22]

13:08:23,320 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-3) MSC000001: 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:272)
        at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA-redhat-2.jar:1.0.2.GA-redhat-2]
        at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA-redhat-2.jar:1.0.2.GA-redhat-2]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.6.0_22]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.6.0_22]
        at java.lang.Thread.run(Thread.java:679) [rt.jar:1.6.0_22]
Caused by: LifecycleException:  Protocol handler initialization failed: java.io.IOException: Alias name test does not identify a key entry
        at org.apache.catalina.connector.Connector.init(Connector.java:1003)
        at org.jboss.as.web.WebConnectorService.start(WebConnectorService.java:268)
    ... 5 more

然后我做了一个keytool -list -v -keystore EntrustL1C.mykeystore,并注意到所有别名都是小写的。

我想知道我是否在配置JBOOS应用程序时遇到了一些根本性的错误,或者这件事是否有效并且我只是犯了一个愚蠢的粗心错误?

非常感谢任何指导。

2 个答案:

答案 0 :(得分:0)

在JBoss配置中的某个地方,您指的是名为“test”的别名。由于你的密钥库没有这样的别名,JBoss抱怨道。在JBoss配置文件(XML,属性等等)中对“test”进行全局搜索(也可以使用包含的引号)可能有助于查明问题。

答案 1 :(得分:0)

在standalone.xml中,请确保您在下面输入

<subsystem xmlns="urn:jboss:domain:web:1.5" default-virtual-server="default-host" native="false">
        <connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http"/>
        <connector name="https" protocol="HTTP/1.1" scheme="https" socket-binding="https" enable-lookups="false" secure="true">
            <ssl name="Certificate issued to Name" key-alias="mykey" password="123456" certificate-key-file="Localtion of Keystore file" cipher-suite="TLS_RSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_AES_256_CBC_SHA" protocol="TLSv1.2" verify-client="false"/>
        </connector>
        <virtual-server name="default-host" enable-welcome-root="true">
            <alias name="localhost"/>
            <alias name="example.com"/>
        </virtual-server>
</subsystem>