2011-10-05 81 views
3

我试图配置BlazeDS通过HTTPS工作。我们在前面设置了Apache,将所有http流量重定向到https。然后,Apache通过http与应用程序(一个JBoss AS 5.1)进行通信。通过HTTPS的BlazeDS

我已经尝试了很多配置为BlazeDS和最终以下解决方案为我工作:

服务-config.xml中

<services-config> 
<services> 
    <service-include file-path="remoting-config.xml" /> 
    <service-include file-path="messaging-config.xml" /> 
</services> 

<channels> 
    <channel-definition id="my-secure-amf" 
     class="mx.messaging.channels.SecureAMFChannel"> 
     <endpoint 
      url="https://{server.name}:{server.port}/{context.root}/messagebroker/amfsecure" 
      class="flex.messaging.endpoints.AMFEndpoint" /> 
     <properties> 
      <add-no-cache-headers>false</add-no-cache-headers> 
     </properties> 
    </channel-definition> 
    </channels> 
</services-config> 

的remoting-config.xml中

<service id="remoting-service" class="flex.messaging.services.RemotingService"> 

<adapters> 
    <adapter-definition id="java-object" class="flex.messaging.services.remoting.adapters.JavaAdapter" default="true"/> 
</adapters> 

<default-channels> 
    <channel ref="my-secure-amf"/> 
</default-channels> 

<destination id="MyService" > 
    <properties> 
     <source>path.to.my.Service</source> 
     <scope>application</scope> 
    </properties> 
</destination> 

这里的事情是,在我的安全AMF通道中,我使用通道定义mx.messaging.channels.SecureAMFChannelflex.messaging.endpoints.AMFEndpoint(而不是flex.messaging.endpoints.SecureAMFEndpoint)。 这可能与Apache-Jboss设置有关,但我还没有找到任何解释不同标签实际定义的内容。

为了让所有这些知道一些,有人可以解释什么时候定义渠道和端点,使用不同的网址和类?

回答

5

它的工作原理是Flex应用程序创建SecureAMFChannel并使用转码后的url信息(url = https:// {server.name}:{server.port}/{context.root}/messagebroker/amfsecure )连接到你的Apache服务器。但是,由于Apache被配置为使用HTTP连接到应用程序,因此您不能使用安全端点(端点将在您的url方案前检查“https”,如果找不到则会引发错误)。

我在我的一个应用程序中使用完全相同的配置(我有一个硬件平衡器而不是Apache服务器)。

+0

此设置是否存在任何安全问题? – thorseye

+0

不,前台Apache服务器和用户之间的信息是加密的。 –