I needed to develop a Flex application on my desktop and test using Tomcat 6 out of the box, without a certificate installed for HTTPS. However I need to deploy that application to a test and production server that force the use of HTTPS.
There is no good documentation on the web explaining how you can do this. It's not difficult. I'm writing this to save you the trial and error process I went through.
#1. In your services-config.xml file you need the following entries to define your amf and amf-secure channels. The trick here is that we make these polling so that the system will be able to switch to the other channel if the first one it tries fails, given that you follow the instructions in Step 2:
<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>
<polling-enabled>true</polling-enabled>
<polling-interval-millis>0</polling-interval-millis>
<wait-interval-millis>-1</wait-interval-millis>
<max-waiting-poll-requests>0</max-waiting-poll-requests>
</properties>
</channel-definition>
<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>
<add-no-cache-headers>false</add-no-cache-headers>
<polling-enabled>true</polling-enabled>
<polling-interval-millis>0</polling-interval-millis>
<wait-interval-millis>-1</wait-interval-millis>
<max-waiting-poll-requests>0</max-waiting-poll-requests>
</properties>
</channel-definition>
#2. In your remoting-config.xml and your proxy-config.xml files define the following. The trick here is that you are defining two channels for use. If one fails the system will try the next.
That's it! As soon as I made the above changes I was able to build and deploy my Flex application to EITHER an https configured server OR and http configured server.