InitialisationException: KeyStore 必须为 Mule Esb 中的服务器端 SSL 配置

Posted

技术标签:

【中文标题】InitialisationException: KeyStore 必须为 Mule Esb 中的服务器端 SSL 配置【英文标题】:InitialisationException: KeyStore must be configured for server side SSL in Mule Esb 【发布时间】:2019-03-15 11:34:49 【问题描述】:

尝试在 mule 中发送 https 请求。

我为服务器生成了 keystore.jks,为客户端生成了 truststore.ts,我将它们放在资源文件夹中,如下图所示:

这里是骡子流:

<?xml version="1.0" encoding="UTF-8"?>

<mule xmlns:tls="http://www.mulesoft.org/schema/mule/tls" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:tracking="http://www.mulesoft.org/schema/mule/ee/tracking" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
    xmlns:spring="http://www.springframework.org/schema/beans" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/ee/tracking http://www.mulesoft.org/schema/mule/ee/tracking/current/mule-tracking-ee.xsd
http://www.mulesoft.org/schema/mule/tls http://www.mulesoft.org/schema/mule/tls/current/mule-tls.xsd">
    <http:listener-config name="HTTPS_8082_OneWaySSL" host="localhost" port="8044" doc:name="HTTP Listener Configuration" protocol="HTTPS">
        <tls:context>
            <tls:key-store type="jks" path="keystore.jks" alias="pcl123" keyPassword="pcl123" password="pcl123"/>
        </tls:context>
    </http:listener-config>
    <http:request-config name="HTTPS_Request_Configuration" protocol="HTTPS" host="localhost" port="8044" doc:name="HTTP Request Configuration">
        <tls:context>
            <tls:trust-store path="truststore.ts" password="pcl123" type="jks" insecure="true"/>
        </tls:context>
    </http:request-config>
    <http:listener-config name="HTTP_8083" host="localhost" port="8045" doc:name="HTTP Listener Configuration"/>

    <http:listener-config name="HTTP_8081" host="localhost" port="8041" doc:name="HTTP Listener Configuration"/>

    <flow name="HTTPS_Client_OneWaySSL">
        <http:listener  config-ref="HTTP_8081" path="/app/*" doc:name="HTTP"/>
        <logger level="INFO" doc:name="Logger"/>
        <http:request config-ref="HTTPS_Request_Configuration" path="/server/*" method="GET" doc:name="Call HTTPS server"/>
        <set-payload value="#[payload]" doc:name="Set Payload"/>
    </flow>

    <flow name="HTTPS_Server_OneWaySSL">
        <http:listener config-ref="HTTPS_8082_OneWaySSL" path="/server/*" doc:name="HTTPS"/>
        <logger level="INFO" doc:name="Logger"/>
        <set-payload value="#['Hey there. You have accessed HTTPS service']" doc:name="Set Payload"/>
    </flow>

</mule>

我成功构建了 mule 项目,但部署失败,如下所示:

org.mule.module.launcher.DeploymentInitException: InitialisationException:必须为服务器端配置 KeyStore SSL

【问题讨论】:

【参考方案1】:

尝试在 tls:key-store 设置中将“别名”更改为“服务器”。 不确定这是否会这样做,但它对我有用。

【讨论】:

以上是关于InitialisationException: KeyStore 必须为 Mule Esb 中的服务器端 SSL 配置的主要内容,如果未能解决你的问题,请参考以下文章