Fix: LibreSSL PSK error (closes )

Fixes "Invalid PSK settings" error using LibreSSL when no PSK is used
This commit is contained in:
Christian W. Zuckschwerdt 2023-02-27 11:56:05 +01:00
parent a9c6866cf7
commit 7cc2623953
2 changed files with 15 additions and 2 deletions

View file

@ -5042,8 +5042,7 @@ static enum mg_ssl_if_result mg_ssl_if_ossl_set_psk(struct mg_ssl_if_ctx *ctx,
const char *identity,
const char *key_str) {
(void) ctx;
(void) identity;
(void) key_str;
if (identity == NULL && key_str == NULL) return MG_SSL_OK;
/* Krypton / LibreSSL does not support PSK. */
return MG_SSL_ERROR;
}

View file

@ -0,0 +1,14 @@
diff --git a/src/mongoose.c b/src/mongoose.c
index d3d2ef99..c9c40863 100644
--- a/src/mongoose.c
+++ b/src/mongoose.c
@@ -5042,8 +5042,7 @@ static enum mg_ssl_if_result mg_ssl_if_ossl_set_psk(struct mg_ssl_if_ctx *ctx,
const char *identity,
const char *key_str) {
(void) ctx;
- (void) identity;
- (void) key_str;
+ if (identity == NULL && key_str == NULL) return MG_SSL_OK;
/* Krypton / LibreSSL does not support PSK. */
return MG_SSL_ERROR;
}