Chat freely about anything...

User avatar
By Herste
#84196 Hello,

it seems that EAP-TLS, which is officially supported, is pretty rarely used. I hardly find any documentation on the web. The following code crashes the ESP8266MOD for unknown reasons - at least unknown to me:

Code: Select all
 wifi_set_opmode(STATION_MODE);

  struct station_config wifi_config;
  memset(&wifi_config, 0, sizeof(wifi_config));
  strcpy((char*)wifi_config.ssid, ssid);
  wifi_station_set_config(&wifi_config);

  wifi_station_clear_cert_key();
  wifi_station_clear_enterprise_ca_cert();
  wifi_station_clear_enterprise_identity();
  wifi_station_clear_enterprise_username();
  wifi_station_clear_enterprise_password();
  wifi_station_clear_enterprise_new_password();
 
 
  wifi_station_set_wpa2_enterprise_auth(1);
  wifi_station_set_enterprise_username((uint8*)identity, strlen(identity));
 
  wifi_station_clear_enterprise_cert_key();
  wifi_station_set_enterprise_cert_key(esp8266_crt, esp8266_crt_len, esp8266_key, esp8266_key_len, NULL, 0);


  wifi_station_connect();




It fails with:

Code: Select all07:37:13.595 -> WPA2 ENTERPRISE VERSION: [v2.0] enable
07:37:13.668 -> scandone
07:37:13.668 -> wifi evt: 8
07:37:13.668 -> wifi evt: 2
07:37:16.530 -> scandone
07:37:17.459 -> state: 0 -> 2 (b0)
07:37:17.492 -> state: 2 -> 3 (0)
07:37:17.492 -> state: 3 -> 5 (10)
07:37:17.492 -> add 0
07:37:17.492 -> aid 1
07:37:17.492 -> cnt
07:37:17.492 -> Fatal exception 28(LoadProhibitedCause):
07:37:17.492 -> epc1=0x40230026, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00000008, depc=0x00000000
07:37:17.529 ->
07:37:17.529 -> Exception (28):
07:37:17.529 -> epc1=0x40230026 epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000008 depc=0x00000000


Any ideas?

Thanks alot for your help!
Herste
User avatar
By Herste
#84210 The code above connects to the Radius server and sends EAP Identity (1) as the authentication type. For EAP-TLS, it should be the value 13. I have not found out how to configure the system to really use EAP-TLS.