Debugging network connections on the iPad. Any tools or techniques? - ios5

I'm trying to get my iPad (3rd gen) to access a website on my workstation over an https connection (though I should perhaps mention I cannot connect to it over HTTP either). The aim is to have a working demo of two-way authentication with certificates.
I've installed the client cert on the iPad and a number of Windows and OSX machines on our network. But the iPad seems to be having trouble getting the IP from the local DNS server or perhaps hitting the DNS server at all. As there doesn't seem to be a Hosts file or any way of debugging the network side of the iPad I'm a bit stuck.
Does anyone have any hints/tips/tools that could make my life half-way bearable?

Unfortunately things like you mention aren't built in in iOS. I would have a look in the App Store and get an app to perform pings and do DNS lookups. Maybe NetTools could work for you?

Related

Cannot connect Charles Proxy to see traffic on any mobile

First of, I can see on traffic coming through when I browse on my desktop.
I have set the IP in network settings along with the port but when I connect I do not get the do you want to connect this phone message from Charles.
I have:
deleted all certificates and tried to go to chls.pro/ssl but get no internet message and the certificate doesn't download.
tried ios and android both with the same result.
tried to manually add it to the access devices in Charles.
The only difference is from two weeks ago when I last did this successfully is the VPN I am on (I open the Charles before connecting to the VPN, to rule that out).
Any suggestions? I am going crazy!
There are various issues that can cause this issue: I collect here and you can verify each step to solve it: https://docs.proxyman.io/troubleshooting/my-ios-devices-couldnt-connect-to-proxyman-via-proxy
I would like to summarize:
Check if your Firewall is blocking all incoming traffic -> Turn it OFF
Stop all VPN app from your iOS device
Make sure your iOS devices and your macOS are in the same network.
Disclaimer: I create the Proxyman app, which is a modern version of Charles-Proxy. Hopefully it helps you resolve the problem.

How can you use Fiddler (or equivalent) with the emulator in the Windows Phone 8 SDK when on a domain/network that uses IPSEC?

Now that the WP8 Emulator is based on Hyper-V, the old method of using Fiddler to intercept network traffic doesn't work if the network uses IPSEC.
Is there a way to use Fiddler and a WP8 emulator in such a scenario?
Fiddler with exactly the same setup as on WP7 (https://fiddler2.com/fiddler/help/phone.asp) works absolutely fine for me.
You grab the traffic from the host system, so the guest (the WP8 emulator) has to bypass that too.
If it doesn't work let me know, but for me and others I know, it runs without any issues.
I finally found the answer at http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj684580(v=vs.105).aspx
On a corporate domain, the emulator appears as a separate network device that is not joined to the domain. As a result, you may also
have to get an exception from your IT department before the emulator
can connect to services that are running on the domain-joined
development computer.
A network security exception was required.
You will probably have to use something like wireshark which works at a sub-protocol level and can therefore intercept anything.
Note that analysis won't be nearly as easy as it is in Fiddler though. Also, HTTPS connections might be impossible to analyze because of the whole man-in-the-middle attack prevention brought on by the protocol and certificates and such.

Connect to attached pc from WP7 by opening a socket to localhost

When developing and testing WP7 apps you're pc is connected to either a real WP7 phone or to the WP7 Device Emulator. For a specific development-purpose I would like to connect directly to the development pc (let's call it the host pc) from the WP7 app without having to rely on an external toast-server. I'm using plain sockets, System.Net.Sockets.Socket.
There seem to be two options:
Obtain the host pc's LAN IP and connect to that
Connect to localhost
Option 1 usually works well, but not always: The host pc may not necessaily have an IP, in which case there's nothing to connect to. Also, in some scenarios all LAN traffic is directed through a company-wide proxy which will disrupt this mechanism.
That lead me to try out option 2. To my surprise it seems to work, but I need to be more sure than simply "it seems to work". I've googled all over but can't find any definitive answer, not even on Microsoft's site like e.g. http://msdn.microsoft.com/en-us/library/ff754351(v=VS.92).aspx. So this is my question:
What exactly is the defined behavior of connecting to localhost from a WP7 app?
Altrernatively, is there a fool-proof way of connecting back to the host-pc?
(Let me stress this again: For this particular purpose I can't use toasts, because the development pc may not even be online.)
Edit:
I work at EQATEC and the application in question is the EQATEC Profiler. Right now the profiler/app-communication is handled by injecting a socket/http-client into the deployed WP7 app that connects back to the profiler's LAN IP address. It works very well and is really fast, but in some very rare cases users are offline and therefore doesn't have an IP, or have some prohibitive lan proxy rules.
Therefore connecting to "localhost" would be excellent if that somehow magically would always work for everybody. It works for me and a couple of test-users, but does it work for all our many thousand profiler users all over the world? I'd like to be more sure.
"localhost" by definition is the machine running the code (well specifically the NIC doing the communication). For either the Phone or the Emulator, that would mean the phone or the emulator, not the PC they are attached to.
When you attach to a PC, you do have a network - it's an RNDIS connection in which both sides get an IP address which traditionally (pre-WP7) could be resolved with 'ppp-peer', though I've not tested that resolution on the Phone. I suspect it will be the same, since WMDC is still what's connecting and they'd have little reason to change that connection mechanism.
If the emulator is resolving localhost to the PC on which is resides, that's a definite bug and I would not count on it continuing to work as they add more robust socket support to the Phone platform.
System.Net.Sockets.Socket isn't really currently available for WP7 programming, but it might be available at some future point (maybe in Mango... maybe...)
AFAIK, the only way to reliably do what you want to do is to set up an http server on the development PC and to provide your app with an HTTP address of that server - or to route messages via some "Cloud proxy"
I'm surprised localhost works at all on the real device... I can only assume that they are asking the connected PC to resolve that DNS name - but even then I'm surprised 127.0.0.1 works.
The ip you're looking for is "192.168.55.100"
That's the ip address the phone uses to connect to the host pc.
If you'd like to connect to the phone, apparently its ip address will be "192.168.55.101"
For the emulator just use localhost or 127.0.0.1
This is from the old ActiveSync days, so I don't know how official it is or how likely it is to last, but for right now at least it worked on my phone.

Issues with httpd over 3G

I am experiencing a strange issue with connecting to my web server from my Iphone4.
I have an app that connects to my web serer and downloads a chunk of JSON. This works fine when i'm connected via WIFI, but fails through 3G. I don't think it's my app, as Safari also fails to retrieve any page on my web server when using 3G.
My web server has a fixed i.p and is running apache/Centos pretty fresh out of the box, I have not messed with the firewall or iptables settings.
The error obtained from the iphone is "The network connection was lost"
It feels like a firewall issue, but i have not explicitly denied any ips. Is there some aspect of a 3g connection that gets denied by default on Linux?
I realise this is all vague at this time, but does anyone have any wisdom to offer?
Many thanks in advance.
Here is a topic related to iphone connection loss through 3G cellular data whereas WiFi works fine, also giving the error "The network connection was lost"
Couple suggestions:
Ensure that your web server is
responding in a timely fashion. If
it is taking a little too much time,
the 3g connection might give up.
Check your web server logs and see if the connection is reaching
your web server at all, and if any
errors are being recorded. If so,
investigate.
There isn't anything special about a 3g connection wrt you web server. Only difference would be that it is less reliable or slower.
How are you actually trying to connect to your web server? When its over wifi you are local on your network and the name of the server will probably work. But when its over 3g its on the interwebs and will probably not respond to the name of the server.

iPhone - access XAMPP server (localhost) on my mac in the same network

I want to create an iPhone app which makes calls to a web service. For testing, I want to first create the API calls on my mac (server running XAMPP) and if it works fine there I want to port it to the actual server.
If my iPhone and mac are on the same network, can I access the web service using the IP address of my mac?
Thanks.
Any time someone answers with "why not," ignore the post. This just takes up space and adds absolutely no value...their post imitating their life.
Anyway, I access my laptop localhost (WAMP stack) from my iPod Touch by entering the IP address of my laptop on my Touch location bar. There is some configuration that needs to happen for this to work. I found what I needed at:
http://www.frihost.com/forums/vt-88381.html
Good Luck!
I can not speak about actual development, however I access intranet pages from a Ipod Touch all the time by either typing http ://ip or http://local_dns_name
As long as the iphone / ipod is on the network correctly (e.g. through standard wifi and not 3g/whatever) you should be able to access any and all local resources.
What I do:
Connected to the same network, I go in to the wireless settings and create a manual proxy that points to my machine. I use Charles proxy for testing a lot/seeing traffic, works like a charm and it lets me use my macbook hosts file so I don't need to do any funky listening rules in apache - just the same vhost settings I use on my machine already.
http://www.charlesproxy.com/documentation/faqs/using-charles-from-an-iphone/
Why not?
Have you tried it and have some problems?