Blackberry firewall "connection inside and outside the firewall" problem - blackberry

Device is 8900 OS version 4.6.1
Getting this exception/message
The application atempted to open a connection to a location inside the firewall and outside the firewall which is not allowed by your security policy
when trying to open an http connection when firewall is on (allowed HTTP connections for the app when prompted). Exact same code works fine on other devices with firewall on.
any ideas?

The firewall in this case is actually the BES firewall - what you're encountering is known as the "split-pipe" scenario where the device is detecting that connections are being made both inside the firewall (via MDS) and outside the firewall (via Wi-Fi, Direct TCP, etc.) There are IT policies that can be enabled by the BES administrator to prevent "split-pipes" from happening. Here's a good forum post with more information:
http://supportforums.blackberry.com/t5/Java-Development/Connecting-your-BlackBerry-http-and-socket-connections-to-the/m-p/206252#M29108

Related

OnDemand VPN required for iOS app, randomly disconnects

I am working on an app that requires access to a resource behind a VPN.
We have on-demand VPN setup using Cisco AnyConnect but we keep running into an issue that in the middle of using the app, the VPN will close.
Sometimes the user will try to log-in, the vpn will establish, user will be logged in, then the VPN will immediately drop.
Is there something I can (or should) do to the NSURLSession that will keep it alive?
I checked my request headers and I have "connection: keep-alive set", but the server is responding "connection: close" is this correct?
Those are two entirely orthogonal things. Keep-alive tells the server that your app is willing to reuse the TCP connection to make multiple HTTP requests instead of creating a separate connection for each request. It has nothing to do with the VPN connection. And the server on the other end is free to refuse keep-alive requests if it doesn't support them (or is configured to refuse them). So that's perfectly reasonable.
The VPN connection dropping is probably caused either by hitting a URL that has been specifically configured to cause the VPN to disconnect or by the VPN crashing, but it could also be caused by too short a timeout in the VPN configuration.
Either way, it is a problem with the VPN or its configuration, and I doubt there's anything you can do about it as the author of an app that is just trying to send data through it. Probably the best you can do is to use reachability to determine whether a request will cause the VPN to connect, and make a note to more aggressively retry requests that fail if you see that flag....
Usually Random disconnection problem in VPNs, is about bad MTU settings on your interfaces. I wrote a complete answer here about how to set MTU in linux, for vpn.
You usually have to has a 1400 MTU for your internet connection interface, and 1300 MTU for your VPN connection.
I don't know how to set it in IOS, but at least you can check your MTU settings to be sure if it's about MTU or not, if you had MTU 1500 then it means your VPN is disconnecting because of it.

IBM Worklight Hybrid App

I Exported Project as an .apk file and installed in My Android Mobile. When i am Using My Company WIFI In My App i am able check the entered user and update password if exist.
when i am connected to Mobile Network its not working.
Ex:- MyServer HostName:192.168.0.16. In My router I Done Portforwarding for 192.168.0.16 and 10080.. My LouterSystem IP Ex:-122.169.78.182.
I am Using SQL Adaptors to connect database.
Iam Getting Following error run app using android emulator:
03-03 04:16:32.358: D/HttpPostRequestSender(1135): WLHybridRequestSender.run in WLHybridRequestSender.java:47 :: Sending request http://122.169.182.78:10800/Infraeasy/apps/services/api/DefaultPassword/android/query
03-03 04:16:32.608: I/Choreographer(1135): Skipped 34 frames! The application may be doing too much work on its main thread.
03-03 04:16:32.718: E/com.worklight.androidgap.plugin.WLNativeXHRPlugin(1135): WLNativeXHRPlugin$NativeXHRPostListener.onException in WLNativeXHRPlugin.java:154 :: onException
03-03 04:16:32.718: E/com.worklight.androidgap.plugin.WLNativeXHRPlugin(1135): org.apache.http.conn.HttpHostConnectException: Connection to http://122.169.182.78:10800 refused
As in your duplicate question: https://stackoverflow.com/questions/28803423/ibm-mobilrfirst-server-issue
The computer that you use to host the server, must be able to accept incoming connections from the public Internet, otherwise the application will not be able to connect to the server.
When the mobile phone and the server are in the same network, then the app is able to connect. Hence, you must verify that:
The server is able to accept connections from the public Internet
That there is no firewall blocking any ports and traffic
If you're getting any errors in LogCat (when you connect the device using a USB cable to your computer), tha would help debugging

"No route to host" error on iOS

I used GCDAsyncUdpSocket to send udp message to discover ssdp service, in iOS reported "No route to host" this error,but there is no problem in the simulator above can be found in service, is that how it happened? I searched a lot of information, but no discovery could help me.
I've run into the same thing. Of course without your source code we can't help you other than to provide vague guesses. I hope you've fixed it by now and if you recall what the problem actually was, please let us know.
Things to check :
Firewall settings on the host. I was trying to receive messages on my mac book and found that Firewall settings can block the port you chose. Firewall is under system preferences on the 3rd tab.
Use apples Reachability class to make sure you've got an active WIFI/Cell connection to the internet. (here : https://developer.apple.com/library/ios/samplecode/Reachability/Listings/Reachability_Reachability_h.html#//apple_ref/doc/uid/DTS40007324-Reachability_Reachability_h-DontLinkElementID_7 )
You can also use other functions in the Reachability class to let you know if the host is reachable before even bothering to open up a socket.
If the host is your mac and the simulator is on the mac, there isn't much of actual network traffic and then when you run on your phone you are actually using real networking. Be aware of, depending on your networking situation, you may need the external IP address of your host (vs the internal network WIFI address e.g. 192.168.1.4 )
Some people have reported a bug where UDP stops working and you get no route to host messages but for some reason turning on and off airplane mode fixes it. Maybe check out their solution (using keep alive messages ever 30 seconds or so to prevent power management from turning off the cell connection). Here is an example : intermittent "No Route to Host" on iOS, flight mode off then on fixes
In case you are developing an App Clip for iOS app, be aware that:
a) Background Session is not supported
b) Multipath is not supported. Setting `multipathServiceType = .handover` on `URLSessionConfiguration` will cause all requests failure due to `No route to host`

iOS enterprise vpn connectivity

In an iOS application if you had to access corporate remote services, through VPN, what would be your pattern to ensure you have connectivity and inform the user if that's not the case:
check that your network and VPN are working (by checking if some host like google.com and some private enterprise host are reachable) and if that's the case then call the remote service?
or call directly the remote service, and if there is a network exception, then check if both a network host and an enterprise host are reachable? (to find-out what's going on and inform the user)
or you would do it differently?
Usual approach:
1)User opens VPN client enables VPN connectivity
2)User uses the app.
Alternative approach:
If you are developing an enterprise application
then you could possibly start and stop VPN connection right from the app using apple's private api.
Advantages of the approach:
So that all the network connections from the app are routed through VPN and user doesn't have to enable VPN connection every time he uses the app.
Reference:
You could find some hot discussions on this topic in the following threads.
Thread 1
Thread 2
Thread 3

Force iOS device app to talk through the local WIFI network

I'm building an application that will run in a museum with a local area wifi network without internet access, for some strange reason I'm not able to fully "join" this network with an iOS device. Enabling internet access on this network solves the problem...
The network should provide only a web server and a DNS server, the access point has a DHCP server, android devices can connect to the network without problems.
When I try to join the network with the device it remains in a "spinning wheel" status, the DHCP server log on the debian server says it has assigned an address to the iOS device, and if I check for the wifi address with an application (like iSys o SBSettings) I see the WIFI DHCP assigned address.
But when my app (or safari) tries to connect to the web server the request is routed through the 3G connection and not completed.
In my app I'm using the standard "Reachability" framework from Apple to check the reachability of a provided host name through the wifi connection and I get 0 on the SCNetworkReachabilityFlags mask....
I'm quite sure the problem is due to the fact iOS (5.1 in my case) tries to check the reachability for some "standard" host in the network, before routing traffic through the WIFI connection.
Anyone knows what an iOS device do to "validate" a WIFI network? I can add hostnames or simple dummy services to the server machine if this can help me connect the device to a LOCAL-only network :)
It seems that iOS doesn't like to join networks without a gateway, also if the network is local you have to setup a correct gateway address.
Setting the gateway as the server itself did the trick and the device started to route TCP/IP over my local area wifi network.

Resources