【问题标题】:Artemis ActiveMQ configuration with SSL support支持 SSL 的 Artemis ActiveMQ 配置
【发布时间】:2020-04-15 12:27:21
【问题描述】:

我正在尝试使用 SSL 设置 Artemis

我的etc/bootstrap.xml 文件看起来像:

<broker xmlns="http://activemq.org/schema">
   <web bind="https://0.0.0.0:8161" path="web" keystorePath="keystore.p12" keystorePassword="123" truststorePath="trusstore.p12" truststorePassword="123">
      <app url="activemq-branding" war="activemq-branding.war"/>
      <app url="artemis-plugin" war="artemis-plugin.war"/>
      <app url="console" war="console.war"/>
   </web>
</broker>

我确实喜欢它是用the documentation 编写的,但是当我运行 artemis 服务时出现错误:

javax.xml.bind.UnmarshalException
 - with linked exception:
[org.xml.sax.SAXParseException; lineNumber: 28; columnNumber: 188; cvc-complex-type.3.2.2: Attribute 'keystorePath' is not allowed to appear in element 'web'.]

我不明白我做错了什么?

【问题讨论】:

    标签: activemq-artemis


    【解决方案1】:

    JAXB 解组区分大小写,因此您可以通过替换以下属性名称来修复此错误:keystorePath > keyStorePath、keystorePassword > keyStorePassword、truststorePath > trustStorePath 和 truststorePassword > trustStorePassword。

    <broker xmlns="http://activemq.org/schema">
       <jaas-security domain="activemq"/>
    
       <server configuration="file:/home/dbruscin/Workspace/temp/apache-artemis-2.11.0/broker/etc//broker.xml"/>
    
       <web bind="https://0.0.0.0:8161" path="web" keyStorePath="keystore.p12" keyStorePassword="123" trustStorePath="trusstore.p12" trustStorePassword="123">
           <app url="activemq-branding" war="activemq-branding.war"/>
           <app url="artemis-plugin" war="artemis-plugin.war"/>
           <app url="console" war="console.war"/>
       </web>
    </broker>
    

    【讨论】:

    • 谢谢!这个问题已解决,但现在我有一些不同的东西:“没有有效的密钥库”我的密钥库有什么问题吗?我将其生成为自签名证书,并且仍然有效。感谢您的帮助
    • 我按照stackoverflow.com/questions/47434877/…中描述的步骤生成了一个有效的自签名密钥库
    • 我会使用属性“${artemis.instance}”,即“${artemis.instance}/etc/keystore.p12”,将keStorePath 和trustStorePath 设置为绝对路径
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-10-13
    • 1970-01-01
    • 2020-04-13
    • 1970-01-01
    相关资源
    最近更新 更多