Skip to content

Commit 89d2f42

Browse files
Note that CERTS.IDX file is generated on-chip (#4902)
Several users have been worried that they need to generate the IDX file, but don't know how. The CertStore code actually writes this file on object creation, and the user never needs to explicitly generate or upload it. Add a comment to the example explicitly noting this.
1 parent 945535a commit 89d2f42

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

libraries/ESP8266WiFi/examples/BearSSL_CertStore/BearSSL_CertStore.ino

+11-7
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@
22
//
33
// Before running, you must download the set of certs using
44
// the script "certs-from-mozilla.py" (no parameters)
5-
// and then uploading the generated data directory to
6-
// SPIFFS.
5+
// and then uploading the generated .AR file to SPIFFS or SD.
6+
//
7+
// You do not need to generate the ".IDX" file listed below,
8+
// it is generated automatically when the CertStore object
9+
// is created and written to SD or SPIFFS by the ESP8266.
710
//
811
// Why would you need a CertStore?
912
//
@@ -19,7 +22,7 @@
1922
// 10s or 100s of CAs against which you can check the
2023
// target's X.509, without taking any more RAM than a single
2124
// certificate. This is the same way that standard browsers
22-
// and operating systems use to verify SSL connections.
25+
// and operating systems verify SSL connections.
2326
//
2427
// About the chosen certs:
2528
// The certificates are scraped from the Mozilla.org current
@@ -82,8 +85,8 @@ class SDCertStoreFile : public BearSSL::CertStoreFile {
8285
const char *_name;
8386
};
8487

85-
SDCertStoreFile certs_idx("/certs.idx");
86-
SDCertStoreFile certs_ar("/certs.ar");
88+
SDCertStoreFile certs_idx("/certs.idx"); // Generated by the ESP8266
89+
SDCertStoreFile certs_ar("/certs.ar"); // Uploaded by the user
8790

8891
#else
8992

@@ -118,8 +121,9 @@ class SPIFFSCertStoreFile : public BearSSL::CertStoreFile {
118121
const char *_name;
119122
};
120123

121-
SPIFFSCertStoreFile certs_idx("/certs.idx");
122-
SPIFFSCertStoreFile certs_ar("/certs.ar");
124+
SPIFFSCertStoreFile certs_idx("/certs.idx"); // Generated by the ESP8266
125+
SPIFFSCertStoreFile certs_ar("/certs.ar"); // Uploaded by the user
126+
123127
#endif
124128

125129
// Set time via NTP, as required for x.509 validation

0 commit comments

Comments
 (0)