title: BlazeDS over HTTPS
body: <p>I'm trying to configure BlazeDS to work over HTTPS. We've got Apache in the front that is set to redirect all http traffic to https. Apache then communicates with the application (a JBoss AS 5.1) via http. </p>
  
  <p>I've tried a lot of configurations for BlazeDS, and finally the following solution worked for me:</p>
  
  <p><strong>services-config.xml</strong></p>
  
  <pre><code>&lt;services-config&gt;
  &lt;services&gt;
      &lt;service-include file-path="remoting-config.xml" /&gt;
      &lt;service-include file-path="messaging-config.xml" /&gt;
  &lt;/services&gt;
  
  &lt;channels&gt;
      &lt;channel-definition id="my-secure-amf"
          class="mx.messaging.channels.SecureAMFChannel"&gt;
          &lt;endpoint
              url="https://{server.name}:{server.port}/{context.root}/messagebroker/amfsecure"
              class="flex.messaging.endpoints.AMFEndpoint" /&gt;
          &lt;properties&gt;
              &lt;add-no-cache-headers&gt;false&lt;/add-no-cache-headers&gt;
          &lt;/properties&gt;
      &lt;/channel-definition&gt;
      &lt;/channels&gt;
  &lt;/services-config&gt;
  </code></pre>
  
  <p><strong>remoting-config.xml</strong></p>
  
  <pre><code>&lt;service id="remoting-service" class="flex.messaging.services.RemotingService"&gt;
  
  &lt;adapters&gt;
      &lt;adapter-definition id="java-object" class="flex.messaging.services.remoting.adapters.JavaAdapter" default="true"/&gt;
  &lt;/adapters&gt;
  
  &lt;default-channels&gt;
      &lt;channel ref="my-secure-amf"/&gt;
  &lt;/default-channels&gt;
  
  &lt;destination id="MyService" &gt;
      &lt;properties&gt;
          &lt;source&gt;path.to.my.Service&lt;/source&gt;
          &lt;scope&gt;application&lt;/scope&gt;
      &lt;/properties&gt;
  &lt;/destination&gt;
  </code></pre>
  
  <p></p>
  
  <p>The thing here is that in my-secure-amf channel, I use <code>mx.messaging.channels.SecureAMFChannel</code> in the channel-definition, and <code>flex.messaging.endpoints.AMFEndpoint</code> (not <code>flex.messaging.endpoints.SecureAMFEndpoint</code>).
  This has probably something with the Apache-Jboss setup to do, but I haven't found anything that explains what the different tags actually define. </p>
  
  <p>To get some sense in all of this, could someone explain what happens when defining channels and endpoint, using different urls and classes?</p>