Openfire 3.6.0 does not accept policy file requests on 5222 port

This is a cross-post from the XIFF discussions.

pacinoj wrote:

I’m using openfire 3.6.0a with XIFF 3.0 beta1 and I am unable to connect due to flash’s policy file. It does not appear that the crossdomain.xml file is being server over port 5222. It works fine when loading the security policy from 5229 but when I remove that line I the policy error. Is there anything special I need to do when connecting?

connection = new XMPPSocketConnection();
/onnection.addEventListener(ConnectionSuccessEvent.CONNECT_SUCCESS, onConnectSuccess);
connection.addEventListener(DisconnectionEvent.DISCONNECT, onDisconnect);
connection.addEventListener(XIFFErrorEvent.XIFF_ERROR, onXiffError);
connection.addEventListener(LoginEvent.LOGIN, onLogin);
connection.addEventListener(MessageEvent.MESSAGE, onMessage);
connection.addEventListener(PresenceEvent.PRESENCE, onPresence);
connection.addEventListener(IncomingDataEvent.INCOMING_DATA, onIncomingData);

connection.useAnonymousLogin = true;
connection.server = server.toString();
connection.port = port;
connection.resource = resourceName;

Thanks for you help!

The crossdomain.xml is served at port 5222 but it seems the patch made for Openfire 3.5.2 and discussed here [PATCH] Allow Openfire to serve cross-domain policy on client port for Flash was broken in 3.6.0. There is a snapshot from the warn.log relating to this issue.

2008.10.10 10:47:55 Closing session due to exception: (SOCKET, R: /, L: /, S:
org.apache.mina.filter.codec.ProtocolDecoderException: java.lang.Exception: Disallowed character (Hexdump: 3C 70 6F 6C 69 63 79 2D 66 69 6C 65 2D 72 65 71 75 65 73 74 2F 3E 00)
at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecF
at$EntryImpl$1.messageReceive d(
at org.apache.mina.filter.executor.ExecutorFilter.processEvent( :239)
at org.apache.mina.filter.executor.ExecutorFilter$
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$ Source)
at Source)
Caused by: java.lang.Exception: Disallowed character
at va:210)
at org.jivesoftware.openfire.nio.XMPPDecoder.doDecode(
at org.apache.mina.filter.codec.CumulativeProtocolDecoder.decode(CumulativeProtoco
at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecF
… 9 more

By the specification string must end with \0 character but the protocol codec does not understand this character.