https://github.com/espressif/arduino-es ... rprise.ino
https://github.com/martinius96/ESP32-ed ... duroam.ino
I can connect to Eduroam fine without the CA cert but when trying to insert the cert file it does not connect.
So I looked here:
https://github.com/espressif/esp-idf/tr ... enterprise
but this inserts the CA cert directly into the binary.
I tried to look into wpa_supplicant
https://github.com/espressif/esp-idf/tr ... supplicant
- esp_err_t esp_eap_client_set_ca_cert(const unsigned char *ca_cert, int ca_cert_len)
- {
- if (ca_cert && ca_cert_len > 0) {
- g_wpa_ca_cert = ca_cert;
- g_wpa_ca_cert_len = ca_cert_len;
- }
- return ESP_OK;
- }
and then here inserting into eap_sm struct.
- int eap_peer_blob_init(struct eap_sm *sm)
- {
- ...
- if (g_wpa_ca_cert && g_wpa_ca_cert_len) {
- sm->blob[2].name = (char *)os_zalloc(BLOB_NAME_LEN+1);
- if (sm->blob[2].name == NULL) {
- ret = -2;
- goto _out;
- }
- os_strlcpy(sm->blob[2].name, CA_CERT_NAME, BLOB_NAME_LEN+1);
- sm->blob[2].len = g_wpa_ca_cert_len;
- sm->blob[2].data = g_wpa_ca_cert;
- }
- ...
- }
In the code bellow there is another place where there is access to ca_cert, but still no matching.
- static int eap_tls_params_from_conf(struct eap_sm *sm,
- struct eap_ssl_data *data,
- struct tls_connection_params *params,
- struct eap_peer_config *config)
- {
- ...
- /*
- * Use blob data, if available. Otherwise, leave reference to external
- * file as-is.
- */
- if (eap_tls_check_blob(sm, ¶ms->ca_cert, ¶ms->ca_cert_blob,
- ¶ms->ca_cert_blob_len) ||
- eap_tls_check_blob(sm, ¶ms->client_cert,
- ¶ms->client_cert_blob,
- ¶ms->client_cert_blob_len) ||
- eap_tls_check_blob(sm, ¶ms->private_key,
- ¶ms->private_key_blob,
- ¶ms->private_key_blob_len)) {
- wpa_printf(MSG_INFO, "SSL: Failed to get configuration blobs");
- return -1;
- }
- ...
- }
But can't find the place where I could see what is going on.
I would like to look into what is coming from the AP and finding out how to edit the pem file written into code so that it matches.
Any idea how to debug this?