-
Notifications
You must be signed in to change notification settings - Fork 7.6k
WPA2 Enterprise PEAP-MSCHAPv2 not working #1381
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
hi @averri PEAP method need certificate to build TLS tunnel, password and username to do MSCHAPv2 verify, I saw you mark down the username set, I think it may the reason why you fail, can you set a legal name and password and try again? Besides, please make sure your server need do certificate verify so that you can build TLS tunnel needn't certificate |
Hi @XinDeng11, thank you very much for your attention. I have set the username together with identity and valid password and it's not working. I have tested the same configuration using my Android phone, and it's working fine. The administrator of the network recommend to use just the identity, without username, and there is no need to set any certificate in the client. This configuration is working fine in the Android phone. So, in summary, this code snippet is not working (using the same username as identity): esp_wifi_sta_wpa2_ent_set_identity((uint8_t *)EAP_ID, strlen(EAP_ID));
esp_wifi_sta_wpa2_ent_set_username((uint8_t *)EAP_USERNAME, strlen(EAP_USERNAME));
esp_wifi_sta_wpa2_ent_set_password((uint8_t *)EAP_PASSWORD, strlen(EAP_PASSWORD)); Do you think I still need to get the server certificate and set it in the code? |
@averri, yeah, there is unnecessary to use user name in TLS method. But it should have a username and password in PEAP method because our ID can not instead of username now. Many phones has installed some common certificates so that it can pass. But PEAP can jump certificate check if it unnessary. Can you offer us your sniffer log(air packets) so that we can check when it failed. |
Hi @XinDeng11, I'll test again with a certificate (presuming a server certificate, because I don't have the client one) and let you know. Thanks for this information. In relation to the sniffer, I don't have access to the router, so the other place we could capture is inside the ESP32, but I'm unaware of any solution like this. I did a test trying to capture the packets in promiscuous mode in the WiFi interface of my notebook, but then I noticed that there are no relevant packets of the authentication process. I have filtered the packets by the MAC address of ESP32. Another option I have is to buy a router with WPA2 Enterprise and create my development environment, where I can easily capture the relevant logs. Please let me know if there is any other option for capturing the sniffer logs. |
I'm having this exactly same issue. I tried to connect to my university's network (eduroam) with the code above but I couldn't succeed. By the way @averri , how can you get this Debug Messages? "Connecting to eduroam |
Also having this problem with "eduroam" |
If I am right, ID to Eduroam is for instance (in my university): xxx48 |
@martinius96 , that does not work. The issue here is not about wrong credentials. |
Understand. |
Today I have tried Eduroam network. Working all ok, connecting about 4 seconds and then connected.
Serial.println("MAC address: ");
} /*
*/ const char* host = "arduino.php5.sk"; void loop() {
// Convert raw temperature in F to Celsius degrees |
@averri Don't answer now. |
@martinius96 I can't get this code to work either. Our network is PEAP and MSCHAP V2. I even tried it setting a certificate, but that results in the "wpa: Method private structure..." error. |
@mickel1138 Hello there, I have tried it on Eduroam network in my university in Slovakia and also on school hostel network, that is under WPA2 Enterprise too (but it isn't Eduroam). Same sketch worked for me on both networks. Both these networks were under PEAP and MsCHAPv2 methods. That's weird. It was first sketch i have used on ESP32 board and it worked. I was using ESP32 DevKit v1 board. Maybe isn't there problem with ID and identity? I got for instance [email protected] for ID and for identity too.. Maybe it isn't same at you, because in my sketch i set ID and IDENTITY same in my sketch in repo. |
@martinius96 I have tried various combinations of ID, and user name. None of those worked. This issues seems to happen to others too, and may have to do with the ESP library build. There is quite a thread on it here: espressif/esp-idf#1297 |
@mickel1138 hmm, understand.. And how about version of ESP32 Arduino core? I was using latest at my tests. |
@martinius96 I just pulled form the GIT repo, no changes, I use Arduino IDE 1.85. Tried different boards. Most likely there is a difference between your network, and the one i'm trying to get on. Like I mentioned before, many people have to same issue, it's not for a lack of trying. Thanks for your help, but i'm going to retire this effort. |
Hello @martinius96 , |
Okay, we can wait for fix.. @mickel1138 |
Hello, In my case my university uses "eduroam" WPA2 Enterprise, TTLS, no certificate, MSCHAPv2(no EAP) // eduroam WPA2 Enterprise, TTLS, no certificate, MSCHAPv2(no EAP) String line; void setup() { Serial.println("MAC address: "); } void loop() { if (!client.connected()) { |
Hi, wpa: X509: Did not find any of the issuers from the list of trusted certificates or failing to provide a proper certificate to server when it was not set up (by commenting out these lines):
It fails this time on server side after this diagnostic appears locally: wpa: TLSv1: Full client certificate chain not configured - validation may fail Android phones are connecting to the network just fine without any certificates being installed. All I know about network configuration so far is that it has been set up by admin with this Cisco how-to. Maybe it will lead someone more knowledgeable in the right direction. There is a discussion here as well. https://www.esp32.com/viewtopic.php?f=2&t=3108&p=29227#p29227 |
Hello there, i have small "update" for you. If code below will not work, try uncomment esp_wifi_sta_wpa2_ent_set_new_password function and comment esp_wifi_sta_wpa2_ent_set_password function.. Sketch can be found in my repo for testing... https://github.com/martinius96/ESP32-Eduroam/blob/master/connect_eduroam_2018_new_fix.ino |
The solution provided by @fabiorochaufsc works with enterprise PEAP MSCHAPv2 without a certificate. I was trying with Eduroam version and can't get a success. Apparently, WIFI_STA mode does the job, many thanks! |
@martinius96 Thanks, but the whole point is that when I try it without the certificate, it fails in another way. I've tried this first so it supposedly depends on network configuration. |
Thanks for feedback... Hm, maybe you are true.. For instance I was unable to join 802.1x network at home, it was under Linux Zeroshell and PEAP + MsCHAPv2 without certificate. I haven't tryed with that WIFI_STA mode. But.. Eduroam networks must be configured under any global "standard" how to set it up. I will let you know if I was sucessful. |
I'm sorry, can you tell me, how does controller choose between PEAP and TLS? I can't find anything in code, where we tell him what to use? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This stale issue has been automatically closed. Thank you for your contributions. |
Hardware:
Board: esp32dev
Core Installation/update date: 04/05/2018
IDE name: Platform.io
Flash Frequency: 80Mhz
Upload Speed: 115200
Description:
The ESP32 cannot connect to WiFi using WPA2 Enterprise PEAP/MSCHAPv2. There is an error message reported, please see below.
Error messages when executing the sketch:
Sketch:
Debug Messages:
The text was updated successfully, but these errors were encountered: