Thanks Giovanni,
the good news is that I'm able to reproduce the issue (same CentOS and libcurl version, but kamailio 5.1.0-pre0).
I still don't understand the root cause though.
In my case under some light load in about 1 case every 20 I see something like this logged (debug level 3):
Nov 2 23:19:56 localhost /usr/local/sbin/kamailio[26767]: INFO: http_async_client [http_multi.c:238]: debug_cb(): [cURL] warning: CURLOPT_CAPATH not a directory (/usr/local/etc/kamailio/ssl/ca/ca.pem)
...
Nov 2 23:19:56 localhost /usr/local/sbin/kamailio[26767]: ERROR: http_async_client [http_multi.c:574]: check_multi_info(): handle 0x7fc351833080 returned error 77:
'/usr/local/etc/kamailio/ssl/ca/ca.pem' is the CA root file, while tls_ca_path is instead set to '/usr/local/etc/kamailio/ssl/ca'.
Can you see that curl warning in your case?
Regards,
Giacomo