【问题标题】:How to configure external vendor SSL certs into JBoss 7.1如何在 JBoss 7.1 中配置外部供应商 SSL 证书
【发布时间】:2014-11-19 09:25:23
【问题描述】:

我正在从 Websphere 8.x 转换到 JBoss 7.1,但在将 SSL 证书导入 JBoss 7.1 时遇到问题。我们通过 SSL 使用外部供应商网络服务。

在 Websphere 中,我会这样做:
将供应商添加到本地 WAS 信任存储:
使用管理控制台中的 Retrieve from port 选项来检索证书并解决问题。
完成以下步骤:

  1. 登录到管理控制台。
  2. 展开安全并单击 SSL 证书和密钥管理。 在配置设置下,单击管理端点安全配置。
  3. 选择适当的出站配置以进入 (cell):E4GT82WNode03Cell:(node):E4GT82WNode03 管理范围。
  4. 在相关项目下,单击密钥存储和证书,然后单击 NodeDefaultTrustStore 密钥存储。
  5. 在其他属性下,单击签名者证书和从端口检索。
  6. 在主机字段中,在主机名字段中输入 services.vendor.com,在端口字段中输入 443,在别名字段中输入 services.vendor.com_cert。
  7. 单击检索签名者信息。
  8. 验证证书信息是否适用于您可以信任的证书。
  9. 点击应用并保存。

但在 JBoss 中,看起来并没有这种能力。我一直在使用 openssl、keytool 来创建、将证书添加到密钥库并尝试对standalone.xml 文件进行更改。我尝试了很多不同的东西,这些东西在不同的搜索结果中得到了建议,我已经尝试了无数个小时来试图弄清楚这一点。

我收到此错误:

13:08:50,801 错误 [org.jboss.as.controller.management-operation] 操作(“添加”)失败 - 地址:([ (“子系统”=>“网络”), (“连接器”=>“https”), ("ssl" => "configuration") ]) - 失败描述:“JBAS014803: Duplicate resource [ (\"子系统\" => \"网络\"), (\"连接器\" => \"https\"), (\"ssl\" => \"配置\") ]"

抛出错误:

    <subsystem xmlns="urn:jboss:domain:web:1.1" 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" secure="true">
        <ssl key-alias="jbosscerts" password="secret" certificate-key-file="D:\opt\jboss-as-7.1.1.Final\keystore\jbosscertstore.keystore" certificate-file="C:/jboss-as-7.1.1.Final\keystore\jbosscertstore.keystore" cipher-suite="ALL" protocol="TLSv1"/>
        <ssl key-alias="vendor1.com_cert" password="secret" certificate-key-file="C:\jboss-as-7.1.1.Final\keystore\jbosscertstore.keystore" certificate-file="C:\jboss-as-7.1.1.Final\keystore\jbosscertstore.keystore" cipher-suite="ALL" protocol="TLSv1"/>
        <ssl key-alias="vendor2.com_cert" password="secret" certificate-key-file="D:\opt\jboss-as-7.1.1.Final\keystore\jbosscertstore.keystore" certificate-file="C:\jboss-as-7.1.1.Final\keystore\jbosscertstore.keystore" cipher-suite="ALL" protocol="TLSv1"/>
      </connector>          
      <virtual-server name="default-host" enable-welcome-root="true">
        <alias name="localhost"/>
        <alias name="example.com"/>
      </virtual-server>
    </subsystem>

不抛出错误:

    <subsystem xmlns="urn:jboss:domain:web:1.1" 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" secure="true">
        <ssl key-alias="jbosscerts" password="secret" certificate-key-file="D:\opt\jboss-as-7.1.1.Final\keystore\jbosscertstore.keystore" certificate-file="C:/jboss-as-7.1.1.Final\keystore\jbosscertstore.keystore" cipher-suite="ALL" protocol="TLSv1"/>
      </connector>          
      <virtual-server name="default-host" enable-welcome-root="true">
        <alias name="localhost"/>
         <alias name="example.com"/>
      </virtual-server>
    </subsystem>

我的问题是: 如何像 Websphere 一样在 JBoss 中配置多个 SSL 证书?

【问题讨论】:

    标签: java ssl jboss


    【解决方案1】:

    您需要为此添加系统属性。所以基本上在&lt;extensions&gt;....&lt;/extensions&gt; 标记之后将以下代码添加到您的standalone.xml 中:

    <system-properties>
            <property name="javax.net.ssl.trustStore" value="<location of cert>"/>
    </system-properties>
    

    &lt;location of cert&gt; 是 Java 密钥库文件的位置,其中包含受此应用程序进程信任的 CA 证书集合(信任库)。请注意,在 Windows 上,指定的路径名​​必须使用正斜杠 / 代替 \

    【讨论】:

    • 谢谢!该属性 - 正是 - 修复了它。(并删除了额外的“ssl key-alias”标签。
    • 标签实际上是用来为您自己的服务器添加证书,即当您在 https 上运行自己的服务器时,将使用此证书。因此,为单个服务器指定多个证书没有任何意义.. :)
    猜你喜欢
    • 1970-01-01
    • 2016-04-03
    • 2016-07-01
    • 1970-01-01
    • 2016-09-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-10-03
    相关资源
    最近更新 更多