Android & talking to wpa_supplicant for TTLS / PEAP / TLS (Runtime+wpa_cli / JNI / LocalSocket(Unix domain socket) / wpa_supplicant.conf?)
Aäron Jansen (Gmail)
aaron.jansen at gmail.com
Fri Feb 19 17:50:10 EST 2010
(I'm new to posting questions on mailing lists. Suggestions on good posting behaviour are appreciated. :) )
FYI: I've also posted this issue on the Android Development Google Group.
This is what I'm trying to achieve: I would like to write an Android app that is capable of talking to wpa_supplicant. More specifically, I would like to connect to a WPA2-EAP secured network (with authentication methods TTLS / PEAP / TLS), but since the device will be used by several users, the user credentials will be supplied by the user in my app, instead of by wpa_suplicant.conf. I don't want to write my own supplicant software, I would like to be able to communicate with it. (I am able to connect to the network when I provide the user credentials as well in the /data/misc/wifi/wpa_supplicant.conf file)
I've looked at several solutions and their problems, and I would like some advice on them. Maybe I've overlooked something:
- Solution 1: Using the Android Wifi API. Problem: The Android WiFi API doesn't seem to support TTLS / PEAP / TLS. Strange other thing is: It appears to support LEAP, but I can't find a way to supply the user credentials to the WifiConfiguration.
- Solution 2: Letting the app write to /data/misc/wifi/wpa_supplicant.conf and then reassociating. Problem: I understand from the API that apps can only write to their own private space or the external SD store. I've also tried writing to a file with the Terminal Emulator app. This doesn't work. I can only write wpa_supplicant.conf in the adb shell with root acces.
- Solution 3: Talking directly to the control interface of wpa_suplicant using Unix domain sockets. I found that the Android API supplies us with the LocalSocket class for this. However, I have no idea how to cummunicate with the wpa_supplicant control interface domain socket. (I will also post this on a wpa_supplicant forum).
- Solution 4: Using java.lang.Runtime and .Process for running wpa_cli and communicating with it. Problem: I expect there will be Manifest.permission conflicts.
- Solution 5: Another option might be to use Android NDK / JNI to be able to use the helper functions in c that wpa_supplicant provides. Problem: This might be a solution, but it seems to me that it complicates matters a lot. And I also wonder if there might be some Manifest.permission conflicts.
- Solution 6: Finding some open source Java supplicant code and adapting this. Problem: I haven't found it yet. (My C skills aren't so good, and it needs to work on Android).
I really need some help on this. Is there somebody with some more experience on this topic? I hope somebody would be able to enlighten me by providing some answers or pointers on where to look.
Any help would be greatly appreciated. Thanks in advance,
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the HostAP