Skip to content

Commit 25245f1

Browse files
committed
Fix up config for reliable ssl error returns.
1 parent c88972f commit 25245f1

File tree

1 file changed

+21
-12
lines changed

1 file changed

+21
-12
lines changed

include/bitcoin/network/ssl/wolfssl/wolfcrypt/user_settings.h

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848

4949
/* Suppress warnings on unnecessary file inclusions. */
5050
#define WOLFSSL_IGNORE_FILE_WARN
51+
#define WOLFSSL_VERBOSE_ERRORS
5152

5253
/* wolfssl.com/documentation/manuals/wolfssl/chapter05.html */
5354
/* Requires that send and receive data copy functions be defined. */
@@ -126,22 +127,30 @@
126127
#endif
127128
#endif
128129

129-
#ifndef NDEBUG
130-
#define DEBUG_WOLFSSL
131-
#define DEBUG_SUITE_TESTS
132-
////#define WOLFSSL_VERBOSE_ERRORS
133-
#define WOLFSSL_HAVE_ERROR_QUEUE
134-
135-
#ifndef WOLFSSL_LOGGINGENABLED_DEFAULT
136-
#define WOLFSSL_LOGGINGENABLED_DEFAULT 1
137-
#endif
138-
#ifndef WOLFSSL_CERT_LOG_ENABLED_DEFAULT
139-
#define WOLFSSL_CERT_LOG_ENABLED_DEFAULT 1
140-
#endif
130+
// Not setting this results in generic codes return from ssl via boost, but
131+
// otherwise some failed calls return success due to lack of error queue being
132+
// populated after a failed API call.
133+
////#define WOLFSSL_HAVE_ERROR_QUEUE
134+
135+
/// Debugging information.
136+
#if !defined(NDEBUG)
137+
// This will crash msvcrt on initialization if locale has been set.
138+
// Work around using logging callback and avoid locale-dependent writes.
139+
////#define DEBUG_WOLFSSL
140+
141+
// These require DEBUG_WOLFSSL.
142+
////#ifndef WOLFSSL_LOGGINGENABLED_DEFAULT
143+
////#define WOLFSSL_LOGGINGENABLED_DEFAULT 1
144+
////#endif
145+
////#ifndef WOLFSSL_CERT_LOG_ENABLED_DEFAULT
146+
////#define WOLFSSL_CERT_LOG_ENABLED_DEFAULT 1
147+
////#endif
141148
#endif
142149

150+
/// WolfSSL tests.
143151
#define NO_MAIN_DRIVER
144152
#define NO_TESTSUITE_MAIN_DRIVER
145153
#define CERT_WRITE_TEMP_DIR "./"
154+
#define DEBUG_SUITE_TESTS
146155

147156
#endif

0 commit comments

Comments
 (0)