Skip to content

Commit 200e47f

Browse files
Fix error when debug enabled but no port chosen (#7648)
When the debug level for the device includes SSL but the debug port is chosen as "None," don't attempt to write debug messages. Fixes #7638
1 parent bc2b13a commit 200e47f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

libraries/ESP8266WiFi/src/CertStoreBearSSL.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#include <memory>
2222

2323

24-
#ifdef DEBUG_ESP_SSL
24+
#if defined(DEBUG_ESP_SSL) && defined(DEBUG_ESP_PORT)
2525
#define DEBUG_BSSL(fmt, ...) DEBUG_ESP_PORT.printf_P((PGM_P)PSTR( "BSSL:" fmt), ## __VA_ARGS__)
2626
#else
2727
#define DEBUG_BSSL(...)

libraries/ESP8266WiFi/src/WiFiClientSecureBearSSL.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ extern "C" {
5959

6060
#endif
6161

62-
#ifdef DEBUG_ESP_SSL
62+
#if defined(DEBUG_ESP_SSL) && defined(DEBUG_ESP_PORT)
6363
#define DEBUG_BSSL(fmt, ...) DEBUG_ESP_PORT.printf_P((PGM_P)PSTR( "BSSL:" fmt), ## __VA_ARGS__)
6464
#else
6565
#define DEBUG_BSSL(...)
@@ -664,7 +664,7 @@ extern "C" {
664664
if (!xc->done_cert) {
665665
br_sha1_update(&xc->sha1_cert, buf, len);
666666
br_x509_decoder_push(&xc->ctx, (const void*)buf, len);
667-
#ifdef DEBUG_ESP_SSL
667+
#if defined(DEBUG_ESP_SSL) && defined(DEBUG_ESP_PORT)
668668
DEBUG_BSSL("CERT: ");
669669
for (size_t i=0; i<len; i++) {
670670
DEBUG_ESP_PORT.printf_P(PSTR("%02x "), buf[i] & 0xff);

0 commit comments

Comments
 (0)