Moodle has a wrapper class curl for the cURL extension which should be used instead of low-level curl functions. The wrapper respects all the other Moodle settings such as proxy and others.
Additionally, turning off options like CURLOPT_SSL_VERIFYPEER is not a good practise and should be avoided.