If you have a proxy between the client and server that rewrites HTTPS requests 
to HTTP requests before forwarding to the app server you need you 
channel-definition to specify a secure client-side channel class and URL, and 
an insecure server side endpoint class. So, something like:

<channel-definition id="secure-amf"
class="mx.messaging.channels.SecureAMFChannel">
<endpoint
uri="https://{server.name}:{server.port}/{context.root}/messagebroker/amf";
class="flex.messaging.endpoints.AMFEndpoint"/>
</channel-definition>

Note that the endpoint class is AMFEndpoint, not SecureAMFEndpoint.

Regarding the error you get when you hit the secure endpoint directly in the 
browser (flex.messaging.MessageException: No configured channel has an endpoint
path '/messagebroker/amfsecure'...); that's odd - are you sure you didn't edit 
your config file without restarting? 

Hope that helps,
Seth

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of sk_acura
Sent: Wednesday, May 21, 2008 10:54 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] RemoteObject connections over HTTPS fails..

HI All,

We have a BalzeDS based web app deployed on tomcat working fine when
we use HTTP.

How ever when we try to expose our web app over extranet the swf files
that tries to connect to the Remote Object gets timed out..

Here are the channels that are configured in the services-config.xml

[CODE]
<channels>
<channel-definition id="my-amf"
class="mx.messaging.channels.AMFChannel">
<endpoint
uri="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
uri="https://{server.name}:{server.port}/{context.root}/messagebroker/amfsecure";
class="flex.messaging.endpoints.SecureAMFEndpoint"/>
</channel-definition>

<channel-definition id="my-polling-amf"
class="mx.messaging.channels.AMFChannel">
<endpoint
uri="http://{server.name}:{server.port}/{context.root}/messagebroker/amfpolling";
class="flex.messaging.endpoints.AMFEndpoint"/>
<properties>
<polling-enabled>true</polling-enabled>
<polling-interval-seconds>8</polling-interval-seconds>
</properties>
</channel-definition>
<channel-definition id="my-http"
class="mx.messaging.channels.HTTPChannel">
<endpoint
uri="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
uri="https://{server.name}:{server.port}/{context.root}/messagebroker/httpsecure";
class="flex.messaging.endpoints.SecureHTTPEndpoint"/>
</channel-definition>
</channels>
[/CODE]

And the default-channels set in remoting-config.xml and
proxy-config.xml are

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

First of all do i need to enable the secure-channels ?? As the https
port is not enabled in the tomcat on which this web app is deployed..

How ever there is a proxy in between which rewrites the https requests
as http requests and redirects them to the tomcat..

When i add the secure channels ( amf and http) in my default-channel list
and i have included the trace target in my main mxml File..

It shows that it is pinging the my-secure-amf endpoint and doesn't get
any response..( i get the same when i connect using http i.e, from the
intranet)

Now when i remove the secure channels from my default channel list and
regenerate the .swf files (i have the servlet mapping configured to
regenerate them if they don't exists already..) i can connect to the
web app from intranet which uses my-amf channel.

How ever when i try to connect over https the trace shows it is not
getting any ping response from my-amf channel..

Also when i try the following URLs from my browser i get an Error..

http://localhost:8080/myapp/messagebroker/amfsecure

[ERROR]
flex.messaging.MessageException: No configured channel has an endpoint
path '/messagebroker/amfsecure'.
flex.messaging.MessageBroker.getEndpoint(MessageBroker.java:318)
flex.messaging.MessageBrokerServlet.service(MessageBrokerServlet.java:329)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
[/ERROR]

I am getting this Error in both intranet (using HTTP) and Extranet
Environments (using Https)

I have read the blog posts related to this
(http://blog.crankybit.com/flex-remoting-over-ssl/)
and doing exactly as it is suggested still unable to resolve the
issue..!!

Thanks
Mars
 

Reply via email to