From c2e60cf3565ad03ed0f80cc5daca5f8a8286eb49 Mon Sep 17 00:00:00 2001 From: Jakub Karolczyk Date: Wed, 21 Sep 2022 10:49:12 +0100 Subject: [PATCH] Fix crash when certificate file is not accessible --- libsofia-sip-ua/tport/tport_type_ws.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libsofia-sip-ua/tport/tport_type_ws.c b/libsofia-sip-ua/tport/tport_type_ws.c index 1f39484f..225a8e6c 100644 --- a/libsofia-sip-ua/tport/tport_type_ws.c +++ b/libsofia-sip-ua/tport/tport_type_ws.c @@ -384,6 +384,11 @@ static int tport_ws_init_primary_secure(tport_primary_t *pri, if (access(chain, R_OK) != 0) chain = NULL; } + if (!(key && cert && chain)) { + tls_log_errors(3, "tport_ws_init_primary_secure", 0); + goto done; + } + init_ssl(); // OpenSSL_add_all_algorithms(); /* load & register cryptos */