2011-07-05 43 views
0

當我運行此:有沒有一種方法可以通過在Mule 2中只指定url來連接到https服務器?

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

我得到這個:

... 
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) 
******************************************************************************** 
... 

回答

2

您需要與客戶端密鑰庫明確配置HTTPS連接器,以便可以讓出站HTTPS調用。這是解釋here(免費註冊需要閱讀本文檔)。

在本質上,它歸結爲:

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

是'path'證書的位置(:// localhost'從'的https得到)?如果是這樣,我怎麼知道'storePassword'? – Tshepang

+1

不,路徑指向您必須使用標準密鑰存儲工具創建的Java密鑰存儲。這樣做時,您將獲取密碼。 –

+0

評論有點太有限... http://stackoverflow.com/q/6623037 – Tshepang

相關問題