From fa1c36dddb8925277e9832cdfacd8d4c87d2e2d1 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Wed, 24 Jun 2015 17:35:21 +0200 Subject: [PATCH] Use /usr/share/linphone/rootca.pem if there is no /etc/ssl/certs directory on linux --- coreapi/linphonecore.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index cd81bf6fe..fef5330e3 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -867,7 +867,13 @@ static void certificates_config_read(LinphoneCore *lc) { const char *rootca; #ifdef __linux + struct stat sb; rootca=lp_config_get_string(lc->config,"sip","root_ca", "/etc/ssl/certs"); + if (stat("/etc/ssl/certs", &sb) != 0 || !S_ISDIR(sb.st_mode)) + { + ms_warning("/etc/ssl/certs not found, using %s instead", ROOT_CA_FILE); + rootca=lp_config_get_string(lc->config,"sip","root_ca", ROOT_CA_FILE); + } #else rootca=lp_config_get_string(lc->config,"sip","root_ca", ROOT_CA_FILE); #endif