7 Replies Latest reply on Mar 10, 2008 10:11 AM by HooMaster

    SSL Issues

    HooMaster Level 1
      I'm attempting to migrate an application onto a secure server, but I've had some difficulty, so I used the Flex ColdFusion wizard to generate a new project on that server. My primary requirement is the use of RemoteObject to access my ColdFusion components.

      1st Problem: Loading the webpage, I get the "This page contains both secure and nonsecure items" error.
      Solution: Unknown
      - I tried re-addressing the external links in the main.html file and .js files to https

      2nd Problem: The RemoteObject property, protocol, was deprecated since v1.5
      LiveDoc's Solution: put "https" in front of your source.
      - That doesn't work if your source is "Acct.components.users"
      Solution: I used a variation of endpoint="https://{server.name}:{server.port}{context.root}/flex2gateway/cfamfsecure"
      - That appeared to change my errors from reading http to https

      Here's a small snippet of my error message:

      errorID = 0
      faultCode = "Client.Error.MessageSend"
      faultDetail = "Channel.Connect.Failed error NetConnection.Call.Failed: HTTP: Failed: url: 'https://www.servername.com/flex2gateway/cfamfsecure'"
      faultString = "Send failed"
      message = "faultCode:Client.Error.MessageSend faultString:'Send failed' faultDetail:'Channel.Connect.Failed error NetConnection.Call.Failed: HTTP: Failed: url: 'https://www.servername.com/flex2gateway/cfamfsecure''"
      name = "Error"
      rootCause = (mx.messaging.events::ChannelFaultEvent)#1

      I'm really just curious if anyone has created a functional Flex application using flash remoting over a secure channel. And, if so, was there something special that you had to do whilst setting up the application to make it work?


        • 1. Re: SSL Issues
          I've had mixed results with RemoteObject. It works beautifully on one system (http), but I've tried for 3-4 months to get it to work on another system (https) with no luck at all. It made no difference how I configured the config-files, it just never worked on SSL.

          I resorted to using the only approach I could get to function correctly (see below). Hope this helps.
          ------------------------------------------------------------------------------------------ ------------
          import mx.collections.ArrayCollection;
          import mx.rpc.events.ResultEvent;
          import flash.net.NetConnection;
          import flash.net.Responder;

          private var acData:ArrayCollection;

          /* Connection Variables */
          public var svc:NetConnection;
          public var gateWay:String = "https://your-server/flashservices/gateway/";
          public var locStr:String = "Acct.components.users";

          private function initApp ():void
          svc = new NetConnection( );
          svc.connect( gateWay );
          svc.call( locStr , new Responder(onResult, onError));

          private function onResult(result:Array):void
          // trace ( 'result[0]:'+result[0]['Cols'] );

          acData= new ArrayCollection ( result );

          private function onError(error:Object):void
          • 2. Re: SSL Issues
            Bryan Dresselhaus Level 1
            I got SSL with cf-amf-secure channel working yesterday. IE is a big pain, make sure you put in the add-no-cache property in your channel setup. Also you may need to make a keytool file with java.

            Here is a link I was provided:

            • 3. SSL Issues
              HooMaster Level 1
              hs_ted, I'm actually getting the app to respond in FireFox using your call method, but IE is showing up blank. It might be becauset I've only disabled my other code as apposed to working your example from scratch. I'll be trying some other things out with this. Thanks.

              Bryan, thanks for the link. The additional links from that page provided some good information about IE caching with SSL, but nothing I did made the application work in IE. I was able to get a very simple app using RemoteObject working in FireFox though, so that's a step.

              I've spent a few weeks working on a fairly sophisticated Flex application, and I'm extremely disheartened now that I've realized migration to SSL is going to be a hurdle. I really don't have a choice but to figure this out, unless I want to redo all of my RemoteObject calls, or... <gasp> switch to Silverlight.

              Thanks for both of your suggestions.
              • 4. Re: SSL Issues
                HooMaster Level 1
                Update: I can't get even the simplest Flex application to not display the "page contains both secure and nonsecure items" error in IE. I have to believe that I'm missing something simple, but I'm blue in the face from checking everything. I even changed all of the plugin link-outs to 'https:'

                My Super-Advanced Flex Application looks like this:
                <mx:Text text="hello"/>

                • 5. Re: SSL Issues
                  hs_ted Level 1
                  I found a lot of suggestions when Googling that error message a couple weeks ago. I only see it when refreshing a Flex app (99% of the time anyway). I've no suggestions on that problem other than Google. Sorry.
                  • 6. Re: SSL Issues
                    HooMaster Level 1
                    I've now been able to get SSL working with RemoteObject on a different server. I believe there is an issue on the original server related to the configuration of the SSL certificate, but I'm not yet certain. One was professionally installed and the other was likely hacked together by an IT-wannabe.

                    On the new server, I was able to get it working by establishing a second definition in the services-config.xml file that I called, "ColdFusionSecure". At first, it only worked in FireFox, but then I added the no-cach line and it began working in IE as well. Now, I've just got to figure out why it's not working on the other server. If anyone has knowledge of SSL issues that could help me, I'd appreciate your thoughts. Thanks again for the helpful suggestions.
                    • 7. Re: SSL Issues
                      HooMaster Level 1
                      I finally got it working, and it was not related to the SSL certificate. The final fixes were a combination of things I had tried before, but I apparently kept missing the right combination or something. Here's what I did:

                      - Instead of using the destination "ColdFusion" in my RemoteObject, I used "ColdFusionSecure"
                      - I added "ColdFusionSecure" as an additional definition in my remoting-config.xml file.
                      - I referenced this definition to the "my-cfamf-secure" channel in my services-config.xml file
                      - I added the <add-no-cache-headers>false</add-no-cache-headers> code to the properties of that channel.

                      I may not fully understand what I had wrong, but it definitely works now. Thanks again for the help.