mirror of
https://github.com/meshtastic/firmware.git
synced 2025-04-29 02:51:17 +00:00
Improve time to generate the SSL certificate
This commit is contained in:
parent
ee70b5996f
commit
62602b54f4
@ -156,7 +156,11 @@ static void drawSSLScreen(OLEDDisplay *display, OLEDDisplayUiState *state, int16
|
|||||||
display->drawString(64 + x, y, "Creating SSL certificate");
|
display->drawString(64 + x, y, "Creating SSL certificate");
|
||||||
|
|
||||||
display->setFont(FONT_SMALL);
|
display->setFont(FONT_SMALL);
|
||||||
display->drawString(64 + x, FONT_HEIGHT_SMALL + y + 2, "Please wait...");
|
if ((millis() / 1000) % 2) {
|
||||||
|
display->drawString(64 + x, FONT_HEIGHT_SMALL + y + 2, "Please wait . . .");
|
||||||
|
} else {
|
||||||
|
display->drawString(64 + x, FONT_HEIGHT_SMALL + y + 2, "Please wait . . ");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAS_EINK
|
#ifdef HAS_EINK
|
||||||
@ -216,7 +220,11 @@ static void drawFrameFirmware(OLEDDisplay *display, OLEDDisplayUiState *state, i
|
|||||||
display->drawString(64 + x, y, "Updating");
|
display->drawString(64 + x, y, "Updating");
|
||||||
|
|
||||||
display->setFont(FONT_SMALL);
|
display->setFont(FONT_SMALL);
|
||||||
display->drawString(64 + x, FONT_HEIGHT_SMALL + y + 2, "Please wait...");
|
if ((millis() / 1000) % 2) {
|
||||||
|
display->drawString(64 + x, FONT_HEIGHT_SMALL + y + 2, "Please wait . . .");
|
||||||
|
} else {
|
||||||
|
display->drawString(64 + x, FONT_HEIGHT_SMALL + y + 2, "Please wait . . ");
|
||||||
|
}
|
||||||
|
|
||||||
// display->setFont(FONT_LARGE);
|
// display->setFont(FONT_LARGE);
|
||||||
// display->drawString(64 + x, 26 + y, btPIN);
|
// display->drawString(64 + x, 26 + y, btPIN);
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
#include <HTTPBodyParser.hpp>
|
#include <HTTPBodyParser.hpp>
|
||||||
#include <HTTPMultipartBodyParser.hpp>
|
#include <HTTPMultipartBodyParser.hpp>
|
||||||
#include <HTTPURLEncodedBodyParser.hpp>
|
#include <HTTPURLEncodedBodyParser.hpp>
|
||||||
|
#include "sleep.h"
|
||||||
|
|
||||||
#include <WebServer.h>
|
#include <WebServer.h>
|
||||||
#include <WiFi.h>
|
#include <WiFi.h>
|
||||||
@ -79,12 +80,14 @@ static void taskCreateCert(void *parameter)
|
|||||||
prefs.begin("MeshtasticHTTPS", false);
|
prefs.begin("MeshtasticHTTPS", false);
|
||||||
|
|
||||||
// Delete the saved certs (used in debugging)
|
// Delete the saved certs (used in debugging)
|
||||||
if (0) {
|
|
||||||
|
#if 0
|
||||||
DEBUG_MSG("Deleting any saved SSL keys ...\n");
|
DEBUG_MSG("Deleting any saved SSL keys ...\n");
|
||||||
// prefs.clear();
|
// prefs.clear();
|
||||||
prefs.remove("PK");
|
prefs.remove("PK");
|
||||||
prefs.remove("cert");
|
prefs.remove("cert");
|
||||||
}
|
#endif
|
||||||
|
|
||||||
|
|
||||||
DEBUG_MSG("Checking if we have a previously saved SSL Certificate.\n");
|
DEBUG_MSG("Checking if we have a previously saved SSL Certificate.\n");
|
||||||
|
|
||||||
@ -103,16 +106,12 @@ static void taskCreateCert(void *parameter)
|
|||||||
cert = new SSLCert(certBuffer, certLen, pkBuffer, pkLen);
|
cert = new SSLCert(certBuffer, certLen, pkBuffer, pkLen);
|
||||||
|
|
||||||
DEBUG_MSG("Retrieved Private Key: %d Bytes\n", cert->getPKLength());
|
DEBUG_MSG("Retrieved Private Key: %d Bytes\n", cert->getPKLength());
|
||||||
// DEBUG_MSG("Retrieved Private Key: " + String(cert->getPKLength()) + " Bytes");
|
|
||||||
// for (int i = 0; i < cert->getPKLength(); i++)
|
|
||||||
// Serial.print(cert->getPKData()[i], HEX);
|
|
||||||
// Serial.println();
|
|
||||||
|
|
||||||
DEBUG_MSG("Retrieved Certificate: %d Bytes\n", cert->getCertLength());
|
DEBUG_MSG("Retrieved Certificate: %d Bytes\n", cert->getCertLength());
|
||||||
// for (int i = 0; i < cert->getCertLength(); i++)
|
|
||||||
// Serial.print(cert->getCertData()[i], HEX);
|
|
||||||
// Serial.println();
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
setCPUFast(true);
|
||||||
|
|
||||||
DEBUG_MSG("Creating the certificate. This may take a while. Please wait...\n");
|
DEBUG_MSG("Creating the certificate. This may take a while. Please wait...\n");
|
||||||
yield();
|
yield();
|
||||||
cert = new SSLCert();
|
cert = new SSLCert();
|
||||||
@ -144,6 +143,9 @@ static void taskCreateCert(void *parameter)
|
|||||||
prefs.putBytes("PK", (uint8_t *)cert->getPKData(), cert->getPKLength());
|
prefs.putBytes("PK", (uint8_t *)cert->getPKData(), cert->getPKLength());
|
||||||
prefs.putBytes("cert", (uint8_t *)cert->getCertData(), cert->getCertLength());
|
prefs.putBytes("cert", (uint8_t *)cert->getCertData(), cert->getCertLength());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setCPUFast(false);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
isCertReady = true;
|
isCertReady = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user