Commit fc19d242 authored by Simon Morlat's avatar Simon Morlat

Avoid a crash when the dtls user certificate path is not set.

parent 66419a35
......@@ -247,6 +247,9 @@ void sal_certificates_chain_parse_directory(char **certificate_pem, char **key_p
*certificate_pem = belle_sip_certificates_chain_get_pem(certificate);
*key_pem = belle_sip_signing_key_get_pem(key);
ms_message("Generate self-signed certificate with CN=%s successful\n", subject);
}else{
ms_error("Self-signed certificate generation failed.");
return;
}
}
}
......
......@@ -1757,6 +1757,7 @@ void MediaSessionPrivate::setupDtlsParams (MediaStream *ms) {
char *certificate = nullptr;
char *key = nullptr;
char *fingerprint = nullptr;
sal_certificates_chain_parse_directory(&certificate, &key, &fingerprint,
linphone_core_get_user_certificates_path(q->getCore()->getCCore()), "linphone-dtls-default-identity", SAL_CERTIFICATE_RAW_FORMAT_PEM, true, true);
if (fingerprint) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment