1

I am trying to connect to an rtmps endpoint in AIR.

The code looks like this:

private function onCreationComplete():void{
    var conn:NetConnection = new NetConnection();
    conn.connect("rtmps://someserver.com/someapplication"); 
    conn.proxyType = "best";
    conn.addEventListener(NetStatusEvent.NET_STATUS,statusHandler);
}

private function statusHandler(event:NetStatusEvent):void{
    var conn:NetConnection = NetConnection(event.target);
    trace(event.info.code);
}

This actually works perfectly when running the app on the desktop in ADL (emulator). However when I install the application (.ipa) on the iPad, the connection fails.

Both my desktop and the iPad connect to the same wireless network (thus use the same network architecture to connect)

Has anyone experienced this kind of behaviour before?

Cheers

Dennis Jaamann
  • 3,547
  • 2
  • 23
  • 42
  • I can only offer cursory help. I've heard of folks who have had things work in emulator, but not on device. I know iOS blocks certain behaviors. I'm not sure if what you're trying to do is one of them. I wonder if the iOS Emulator does not properly 'limit' functionality. Good luck! – JeffryHouser Sep 09 '11 at 12:49
  • My first hunch would be that there might be some certificate issue since I guess that it will be handled by the OS itself through an API in the AIR runtime. I would like to find a spec on this :) – Dennis Jaamann Sep 09 '11 at 13:21
  • And indeed, there are some issues with the emulator since people are logging feature requests in the adobe jira http://bugs.adobe.com/jira/browse/FB-31245 – Dennis Jaamann Sep 09 '11 at 14:56
  • It appears that my first hunch was the right one. I noticed that our streaming server has an AES 256 bit certificate, which is apparently not supported in iOS by default. – Dennis Jaamann Sep 09 '11 at 15:36
  • @DennisJaamann, When you find the fix, please post it as this might be helpful for other people. Also, the hell is apple thinking with no 256 AES support? – J_A_X Sep 12 '11 at 02:47
  • Well, at this moment I'm not sure yet whether they don't support it. However when browsing to the our server root url, it loads in every browser on every operating system except for iOS (with AES 256). When doing the same with an AES 128 server like encrypted.google.com it tends to be working in safari in iOS as well. This implies that it looks like some SSL handshake is failing. Trying to determine now whether its the server setup or the certificate. – Dennis Jaamann Sep 12 '11 at 07:11
  • @J_A_X, we have ruled out the certificate as the culprit, read my answer for explanation. – Dennis Jaamann Sep 15 '11 at 10:40

3 Answers3

1

After some serious efforts to figure out what was wrong here,

We were unable to establish a connection to our server via rtmps.
Regular rtmp seems to be fine but is not unfortunately not an option for us.

*EDIT*
This problem was solved in the AIR 3.1 release.
Turns out connecting via WIFI + Proxy via RTMPS was failing for iOS.
Check out the AIR 3.1 release notes for more information on this.

Dennis Jaamann
  • 3,547
  • 2
  • 23
  • 42
1

We establish connection to the server only through the RTMP protocol.use rtmp instead rtmps,the connection can be established.

Agan
  • 11
  • 1
1

This is still a problem with Air 3.1. I have raised a bug report with Adobe - https://bugbase.adobe.com/index.cfm?event=bug&id=3133542

codeghost
  • 1,014
  • 7
  • 14
  • 1
    You can get rtmps connections on iOS to work with Flex, but you have to use a recognised SSL certificate, not a self-generated one. When connecting using a self cert with Android you get the option to authorise it, where as iOS just silently fails. So buy a cert from someone like Verisign and you should be good. My companies app myCast (http://codeghost.co.uk/mycast) is built with Flex and can successfully connect to rtmps. – codeghost Feb 12 '13 at 08:34