Skip to content

Commit

Permalink
Note that CERTS.IDX file is generated on-chip (esp8266#4902)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
earlephilhower authored Jul 9, 2018
1 parent 945535a commit 89d2f42
Showing 1 changed file with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@
//
// Before running, you must download the set of certs using
// the script "certs-from-mozilla.py" (no parameters)
// and then uploading the generated data directory to
// SPIFFS.
// and then uploading the generated .AR file to SPIFFS or SD.
//
// You do not need to generate the ".IDX" file listed below,
// it is generated automatically when the CertStore object
// is created and written to SD or SPIFFS by the ESP8266.
//
// Why would you need a CertStore?
//
Expand All @@ -19,7 +22,7 @@
// 10s or 100s of CAs against which you can check the
// target's X.509, without taking any more RAM than a single
// certificate. This is the same way that standard browsers
// and operating systems use to verify SSL connections.
// and operating systems verify SSL connections.
//
// About the chosen certs:
// The certificates are scraped from the Mozilla.org current
Expand Down Expand Up @@ -82,8 +85,8 @@ class SDCertStoreFile : public BearSSL::CertStoreFile {
const char *_name;
};

SDCertStoreFile certs_idx("/certs.idx");
SDCertStoreFile certs_ar("/certs.ar");
SDCertStoreFile certs_idx("/certs.idx"); // Generated by the ESP8266
SDCertStoreFile certs_ar("/certs.ar"); // Uploaded by the user

#else

Expand Down Expand Up @@ -118,8 +121,9 @@ class SPIFFSCertStoreFile : public BearSSL::CertStoreFile {
const char *_name;
};

SPIFFSCertStoreFile certs_idx("/certs.idx");
SPIFFSCertStoreFile certs_ar("/certs.ar");
SPIFFSCertStoreFile certs_idx("/certs.idx"); // Generated by the ESP8266
SPIFFSCertStoreFile certs_ar("/certs.ar"); // Uploaded by the user

#endif

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

0 comments on commit 89d2f42

Please sign in to comment.