简体   繁体   中英

Issue in setting flex app in load balanced environment using SSL

I have developed the dashboard in my application using flex 3.0. For this I have used JSP wrapper around the flex application. My application runs on JBoss application server. for communication between flex app and my application i am using LCDS. HTTPService component is being used to receive data from the server. Channel definitions are given in service-config.xml for amf and http channels and for both secure secure and not secure mode. In my proxy-config.xml i have defined Channels and destinations.

services-config.xml

...
...

<channel-definition id="my-amf" class="mx.messaging.channels.AMFChannel">
    <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/amf" class="flex.messaging.endpoints.AMFEndpoint"/>
    <properties>
          <polling-enabled>false</polling-enabled>
    </properties>
</channel-definition>

<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.SecureAMFEndpoint"/>
    <properties>
          <add-no-cache-headers>false</add-no-cache-headers>
    </properties>
</channel-definition>

<channel-definition id="my-http" class="mx.messaging.channels.HTTPChannel">
    <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/http" class="flex.messaging.endpoints.HTTPEndpoint"/>
</channel-definition>

<channel-definition id="my-secure-http" class="mx.messaging.channels.SecureHTTPChannel">
    <endpoint url="https://{server.name}:{server.port}/{context.root}/messagebroker/httpsecure" class="flex.messaging.endpoints.SecureHTTPEndpoint"/>
    <properties>
        <add-no-cache-headers>false</add-no-cache-headers>
    </properties>
</channel-definition>


...
...



proxy-config.xml



...
...

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

...
...

<destination id="dashboardService">
    <properties>
<url>/kr/servlet/DashboardServlet</url>
    </properties>
</destination>

<destination id="dashboardJSPService">
    <properties>
<url>/kr/krportal/dashboardJSPService.jsf</url>
    </properties>
</destination>



...

...

In my development environment both secure and non secure mode were working fine. Now when I have deployed it behind the load balancer(which accepts secure requests only and if the request is not secure it redirects it to secure url) there is no response from the message broker servlet. One thing more I have observed is when the environment is non load balanced there are request like 'http://{server.name}:{server.port}/{context.root}/messagebroker/http'. and these requests are post request. But in load balanced environment with ssl the request is again like 'http://{server.name}:{server.port}/{context.root}/messagebroker/http' which is a post request and it is redirected to 'https://{server.name}:{server.port}/{context.root}/messagebroker/http' which is a get request. The content returned by this get request is null.

Looking for some comments

Thanks

This config file is used by both flex and lcds. Flex uses it to send messages to a specific endpoint and lcds uses this file to actually create the endpoints. You'll notice the at the end of the urls you see /amf, /amfsecure, /http, and /httpsecure. If your load balancer is redirecting a call like http://domain.com/app/messagebroker/amf to https://domain.com/app/messagebroker/amf it will fail because the ssl endpoint ends with /amfsecure.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM