I am having a strange problem with the below php function. Unfortunately this is one of those special \"Production only\" case.
function requestPost($url, $data)
The stack trace clearly shows that the break you did occur within the NSS crypto library that your libcurl is built to use for SSL.
libcurl has got a lot of NSS-related fixes since the libcurl version you use, and possibly you're not using the most up-to-date NSS either. I would strongly suggest that you consider upgrading to the latest and greatest before you pull all your hair out on this problem.
To debug this problem, I would recommend you try to repeat it with the curl command line from the same server, and make good use of the --trace-ascii command.