Skip to content

Commit

Permalink
fix setCACertBundle() signature
Browse files Browse the repository at this point in the history
dieser Bug ist beim Firmwareupdate jedenfalls noch präsent, unklar ob das schon alles war:

Symptom:

E (640) esp-x509-crt-bundle: Invalid certificate bundle
...
[434608][E][ssl_client.cpp:213] start_ssl_client(): useRootCABundle is set, but attach_ssl_certificate_bundle(ssl, true); was not called!
[434620][V][ssl_client.cpp:288] start_ssl_client(): Setting hostname for TLS session...
[434628][V][ssl_client.cpp:309] ssl_starttls_handshake(): Performing the SSL/TLS handshake...
[434670][E][ssl_client.cpp:36] _handle_error(): [ssl_starttls_handshake():313]: (-30336) SSL - No CA Chain is set, but required to operate
[434683][E][NetworkClientSecure.cpp:159] connect(): start_ssl_client: connect failed: -30336
[434691][V][ssl_client.cpp:360] stop_ssl_socket(): Cleaning SSL connection.
[434699][D][HTTPClient.cpp:1105] connect(): failed connect to objects.githubusercontent.com:443

bug report espressif/arduino-esp32#10099

fix in Arduino master espressif/arduino-esp32@f350d16

mir ist leider unklar warum, der sollte in Arduino 3.0.4 fefixt sein :-/
  • Loading branch information
Michael Haberler committed Aug 5, 2024
1 parent a607be5 commit ee30d99
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/PsychicMqttClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ PsychicMqttClient &PsychicMqttClient::setCACert(const char *rootCA, size_t rootC
return *this;
}

PsychicMqttClient &PsychicMqttClient::setCACertBundle(const uint8_t *bundle)
PsychicMqttClient &PsychicMqttClient::setCACertBundle(const uint8_t *bundle, size_t bundleLen)
{
if (bundle != nullptr)
{
esp_crt_bundle_set(bundle, strlen((const char*)bundle));
esp_crt_bundle_set(bundle, bundleLen);
_mqtt_cfg.broker.verification.crt_bundle_attach = esp_crt_bundle_attach;
}
else
Expand Down
2 changes: 1 addition & 1 deletion src/PsychicMqttClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ class PsychicMqttClient
* @param bundle The certificate bundle in PEM or DER format.
* @return A reference to the PsychicMqttClient instance.
*/
PsychicMqttClient &setCACertBundle(const uint8_t *bundle);
PsychicMqttClient &setCACertBundle(const uint8_t *bundle, size_t bundleLen = 0);

/**
* @brief Attaches an existing CA root certificate bundle for the MQTT server. Like if you
Expand Down

0 comments on commit ee30d99

Please sign in to comment.