5 Replies Latest reply on May 3, 2011 6:49 AM by srvikram13

    Security.loadPolicyFile("xmlsocket:

    perflexed Level 1

      Hi All,

        I am trying to load a policy file from a remote server so that I can make socket connections to web service.

      So I am using the following code to connect to the policy server :

      Security.loadPolicyFile("xmlsocket://remote:6969");

      This does not connect to the policy server.

       

      Security.loadPolicyFile("http://remote:6969");

      This does connect, but obviously doesn't work (I'm using a simple python server to serve the policy file).

      So, any ideas as to why I can make a http connect but xmlsocket fails?

      I can telnet from my local machine to the remote machine. The port is open...

       

      thanks

        • 1. Re: Security.loadPolicyFile("xmlsocket:
          saisri2k2 Level 4

          I dont know why, but a i've seen a couple of client who use Sockects use two ports - one for the handling requests, and one for the policy file

           

          eg: 8080 - will have Jboss server  and 8081 will have another small server(like tomcat) for hosting the policy file(with no securities/authentications etc.,) may b you can try that.

          • 3. Re: Security.loadPolicyFile("xmlsocket:
            perflexed Level 1

            The problem is not so much that I cannot connect to the policy server at all, I can if I use http://, but if I try using xmlsocket:// there is no connection made, which is puzzling.

            • 4. Re: Security.loadPolicyFile("xmlsocket:
              saisri2k2 Level 4

              Yeah, first time you need to connect  as http, later on you need to connect as xmlsocket. I've posted a link in my previos post, please refer that.

               

              Edit: please ignore  this line, but please refer to the link in one of my previous post

              • 5. Re: Security.loadPolicyFile("xmlsocket:
                srvikram13

                Hi perflexed,

                 

                perflexed wrote:

                 

                Hi All,

                  I am trying to load a policy file from a remote server so that I can make socket connections to web service.

                So I am using the following code to connect to the policy server :

                Security.loadPolicyFile("xmlsocket://remote:6969");

                This does not connect to the policy server.

                 

                Security.loadPolicyFile("http://remote:6969");

                This does connect, but obviously doesn't work (I'm using a simple python server to serve the policy file).

                So, any ideas as to why I can make a http connect but xmlsocket fails?

                I can telnet from my local machine to the remote machine. The port is open...

                 

                thanks

                You've mentioned that,

                 

                Security.loadPolicyFile("xmlsocket://remote:6969");

                 

                does not connect to the policy server. By that, do you mean that it cannot CONNECT or it is able to connect but the cross domain xml is not received?

                 

                Also, the call to loadPolicyFile using 'http' will be futile since cross domain policies in case of socket connections need to be served over a socket on the target domain. This change has been recently made to the Flash Player (for details you can refer the white paper on Flash Player Security).

                 

                So, forget trying to do loadPolicyFile from the http location. Try and load the policy file using loadPolicyFile("xmlsocket://remote:6969");

                If you are getting the cross-domain xml when you telnet to the remote machine then you need to check for one scenario mentioned in my comment on this post .

                 

                Hope this helps!