Is there a way to connect to https server by specifying only the url in Mule 2?

你离开我真会死。 提交于 2020-01-06 14:02:02

问题


When I run this:

<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesource.org/schema/mule/core/2.2"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:http="http://www.mulesource.org/schema/mule/http/2.2"
    xmlns:https="http://www.mulesource.org/schema/mule/https/2.2"
    xsi:schemaLocation="
        http://www.mulesource.org/schema/mule/http/2.2 http://www.mulesource.org/schema/mule/http/2.2/mule-http.xsd
        http://www.mulesource.org/schema/mule/https/2.2 http://www.mulesource.org/schema/mule/https/2.2/mule-https.xsd
        http://www.mulesource.org/schema/mule/core/2.2 http://www.mulesource.org/schema/mule/core/2.2/mule.xsd">

    <model>
        <service name="ConnectToHTTPS">
            <inbound>
                <http:inbound-endpoint host="localhost"
                                       port="9000"
                                       synchronous="true"/>
            </inbound>
            <outbound>
                <chaining-router>
                    <outbound-endpoint address="https://localhost"
                                       synchronous="true"/>
                </chaining-router>
            </outbound>
        </service>
    </model>
</mule>

I get this:

...
ERROR 2011-07-05 13:06:28,826 [main] org.mule.MuleServer: 
********************************************************************************
Message               : Failed to invoke lifecycle phase "initialise" on object: HttpsConnector{this=1efe475, started=false, initialised=false, name='connector.https.0', disposed=false, numberOfConcurrentTransactedReceivers=4, createMultipleTransactedReceivers=true, connected=false, supportedProtocols=[https], serviceOverrides=null}
Type                  : org.mule.api.lifecycle.LifecycleException
Code                  : MULE_ERROR-70228
JavaDoc               : http://www.mulesource.org/docs/site/current2/apidocs/org/mule/api/lifecycle/LifecycleException.html
********************************************************************************
Exception stack is:
1. The Key password cannot be null (java.lang.IllegalArgumentException)
  org.mule.api.security.tls.TlsConfiguration:290 (null)
2. Failed to invoke lifecycle phase "initialise" on object: HttpsConnector{this=1efe475, started=false, initialised=false, name='connector.https.0', disposed=false, numberOfConcurrentTransactedReceivers=4, createMultipleTransactedReceivers=true, connected=false, supportedProtocols=[https], serviceOverrides=null} (org.mule.api.lifecycle.LifecycleException)
  org.mule.lifecycle.DefaultLifecyclePhase:277 (http://www.mulesource.org/docs/site/current2/apidocs/org/mule/api/lifecycle/LifecycleException.html)
********************************************************************************
...

回答1:


You need to explicitly configure the HTTPS connector with a client keystore so you can make outbound HTTPS calls. This is explained here (free registration required to read this doc).

In essence, it boils down to this:

<https:connector name="httpConnector">
    <https:tls-client path="clientKeystore" storePassword="mulepassword"/>
</https:connector>


来源:https://stackoverflow.com/questions/6581752/is-there-a-way-to-connect-to-https-server-by-specifying-only-the-url-in-mule-2

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!