WPA2-enterprise + PEAP
Can ESP connect to WPA2-enterprise + PEAP networks ? If yes, how to do that ?
There is a longer discussion of this topic on the esp8266 forum http://www.esp8266.com/viewtopic.php?f=6&t=1243&start=15.
WPA2-enterprise is supported in SDK 1.5, so linking this to #1102.
I suspect only eap-tls is supported.
See http://bbs.espressif.com/download/file.php?id=988. The only reference to wpa2-enterprise is in wifi_station_set_cert_key
Also:
$ ar -t esp_iot_sdk_v1/esp_iot_sdk_v1.5.0/lib/libwpa2.a / // asn1.o/ base64.o/ bignum.o/ eap_common.o/ eap.o/ /0 eap_tls.o/ ext_password.o/ pkcs1.o/ pkcs5.o/ pkcs8.o/ rsa.o/ tls_internal.o/ tlsv1_client.o/ /18 /39 tlsv1_common.o/ tlsv1_cred.o/ tlsv1_record.o/ tlsv1_server.o/ /61 /82 x509v3.o/
HI guys. Finally WPA2 Enterprise is supported. But I cannot find any example. Actually I saw that only 1 person got it working. My question is: I need to fill in a username (identity) and a password for the WPA2 and no private key or something like that. Where to fill in the "username" ? Or is this not supported yet. I know this is not an arduino question. But anyway here are the specialists :)
I have not yet added -lwpa2 to linker flag because I wasn't able to get WPA2-Enterprise to work.
If anyone wants to try, feel free to add this flag here
@igrr shouldn't that be line 33? Either way that doesn't work for me, I included
#include <user_interface.h>
...
wifi_station_clear_cert_key();
... in my code to see if that would build, but it doesn't:
sketch_dec20a.ino:5: undefined reference to `wifi_station_clear_cert_key()' collect2: error: ld returned 1 exit status
But I'm not sure this is the right way to call those functions.
You need to wrap that include with extern "C":
extern "C" {
#include "user_interface.h"
}
Regarding line number: after I wrote that comment a few lines got added, so now compiler.c.elf.libs is on line 33.
@igrr extern "C" does get me further, except for this:
/Applications/Arduino.app/Contents/Java/hardware/esp8266com/esp8266/tools/sdk/lib/libcrypto.a(aes-internal-dec.o):(.irom0.text+0x4): undefined reference to Td0'
/Applications/Arduino.app/Contents/Java/hardware/esp8266com/esp8266/tools/sdk/lib/libcrypto.a(aes-internal-dec.o): In function aes_decrypt_init': (.irom0.text+0x134): undefined reference to Td4s'
collect2: error: ld returned 1 exit status`
I hope you know what's missing :-)
I also added the -lwpa2 parameter. I have exact the same error as Paul. Same result when I tried this new function: wifi_station_clear_cert_key();
Should be fixed by 70cf3c3
Yes, now it compiles. Thanks Igrr, Back to my first question. Where to put the username (Identity)? How does it work? I am missing one part of the puzzle. And I do not know which
@igrr Great, that compiles and I've actually got it to authenticate. But: with the wrong User-Name, that seems to be set to "tianhao" and not taken from the certificate CN. Maybe it uses the Microsoft UPN attribute or a subjectAltName; I'll try to experiment with that, but suggestions are welcome.
I also need to connect to a WPA2 Enterprise secured network, it requirers user authentication that is Username + Password, no certificate. The server certificate is a self signed one.
Did anyone got this to work? And if so is there a guide + example
So far only EAP-TLS is supported; so client-certificate based and not username/password. This works fine for me, but if you have no client-certificate and no control over the RADIUS server, I don't think you can do a lot (but wait for a series of other EAP-mechanisms to be supported).
I have full control over the RADIUS server just never configured anything else than user name based. If I have to add certificate based (if that can coexist) than its doable. Still how do I do that on the arduino side?
You can use something like https://github.com/joostd/esp8266-eduroam/blob/master/Arduino/eduroam/eduroam.ino. At the moment, it needs a patched esp8266 Arduino core (https://github.com/esp8266/Arduino/pull/1633)
FYI Espressif just released 1.5.3 which adds username/password support.
Alas, all that 1.5.3 adds are the missing prototypes in include/user_interface.h (wifi_station_set_username and wifi_station_clear_username). These are not used for username/password authentication, but for setting/clearing the username used in EAP. As such, EAP-TLS (i.e. using client certificates) is still the only supported EAP method.
(In fact lib/libwpa2.a has not changed since version 1.5.2).
It does mean that PR #1633 is no longer necessary once the SDK is upgraded to 1.5.3.
@joostd Yeah I didn't notice that at first.. got a bit excited. I haven't been able to get PEAP going at my workplace.
I'm very interested. Can someone give a quick run down of the step by step for what almost "works" as of right now so I could give it a try? I take it it's only certificate based and not identity/password based that works (would be nice, but ok).
Edit: Are we waiting on Espressif for the identity/password bit?