开发者

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

开发者 https://www.devze.com 2023-03-18 15:05 出处:网络
When I run this: <?xml version=\"1.0\" encoding=\"UTF-8\"?> <mule xmlns=\"http://www.mulesource.org/schema/mule/core/2.2\"

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.LifecycleExcepti开发者_高级运维on
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)
********************************************************************************
...


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>
0

精彩评论

暂无评论...
验证码 换一张
取 消