From 645447dcef7679a54b080501ab3905ad00f4c82f Mon Sep 17 00:00:00 2001 From: Guillaume Beraudo Date: Fri, 28 Feb 2014 12:52:52 +0100 Subject: [PATCH] Simplify client certificate configuration. We can only handle one client certificate: allow setting direct path to the chain and key files. --- coreapi/callbacks.c | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/coreapi/callbacks.c b/coreapi/callbacks.c index 033b1660b..1da9b56a9 100644 --- a/coreapi/callbacks.c +++ b/coreapi/callbacks.c @@ -924,25 +924,9 @@ static void ping_reply(SalOp *op){ } } -static const char *get_client_cert_path(LinphoneCore *lc) { - static char cldir[200] = {0}; - #ifdef HAVE_GETENV - if (!cldir[0]) { - static char default_path[200] = {0}; - snprintf(default_path, sizeof(default_path), "%s%s", getenv("HOME"), "/linphone_certs"); - snprintf(cldir, sizeof(cldir), "%s", lp_config_get_string(lc->config,"sip","client_certificates_dir", default_path)); - } - #endif - return cldir; -} static bool_t fill_auth_info_with_client_certificate(LinphoneCore *lc, SalAuthInfo* sai) { - char chain_file[200]; - char key_file[200]; - const char *path = get_client_cert_path(lc); - - snprintf(chain_file, sizeof(chain_file), "%s%s", path, "/chain.pem"); - - snprintf(key_file, sizeof(key_file), "%s%s", path, "/key.pem"); + const char *chain_file = lp_config_get_string(lc->config,"sip","client_cert_chain", 0); + const char *key_file = lp_config_get_string(lc->config,"sip","client_cert_key", 0);; #ifndef WIN32 {