Letsencrypt auf ESP32

Gast #6824055
Lesenswert?

Hi,

evtl. bin ich auch nur unfähig zu Googlen ^^

aber hat schonmal jemand SSL-Zertifikate für eine Verschlüsselte 
Kommunikations durchs Internet auf einem ESP32 zu laufen gebracht?
Am coolsten wäre ja sowas wie LetsEncrypt.

Evtl. hat ja jemand Ideen für mich :)

Danke & Grüße
#6824402
Lesenswert?

Bastler schrieb:
> Geht nicht so, wie bei einem "normalen" Webserver, d.h. Zertifikate im
> Filesystem ablegen.

Warum nicht?

Du brauchst ja nur ein "SSLCert"-Objekt richtig zu initialisieren. Und 
das geht aus zwei char* mit Längenangabe.
1
class SSLCert {
2
public:
3
  /**
4
   * \brief Creates a new SSLCert.
5
   * 
6
   * The certificate and key data may be NULL (default values) if the certificate is meant
7
   * to be passed to createSelfSignedCert().
8
   * 
9
   * Otherwise, the data must reside in a memory location that is not deleted until the server
10
   * using the certificate is stopped.
11
   * 
12
   * \param[in] certData The certificate data to use (DER format)
13
   * \param[in] certLength The length of the certificate data
14
   * \param[in] pkData The private key data to use (DER format)
15
   * \param[in] pkLength The length of the private key
16
   */
17
  SSLCert(
18
    unsigned char * certData = NULL,
19
    uint16_t certLength = 0,
20
    unsigned char * pkData = NULL,
21
    uint16_t pkLength = 0
22
  );
23
...

d.H. garkein Problem, das aus Dateien zu lesen, solang du den Lesebuffer 
nicht zu früh freigibst: ("the data must reside in a memory location 
that is not deleted")

Nur vorher umwandeln in's DER-Format, direkt mit X509 - Ascii-Encoded 
files kommt er nicht klar.
1
openssl rsa -in example.key -outform DER -out example.key.DER
2
openssl x509 -in example.crt -outform DER -out example.crt.DER

Antwort schreiben

Bitte melde dich an, um einen Beitrag zu schreiben.

oder

Mit Google-Account einloggen

Die Registrierung ist kostenlos und dauert nur eine Minute.

Jetzt registrieren