I'm trying to use Phalanger to compile a script I wrote in PHP into a standalone executable. The script utilizes PHP's cURL extension to make various REST calls. This actually works fine so long as the websites it hits use http; however it fails any time I try to hit https endpoints.
I have tried adding this line into the PHP source:
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
That would just ignore any SSL validation; however it doesn't work. It actually does work if I run the script in PHP, but when I compile it using Phalanger to an executable, it spits out this warning:
Warning: curl_setopt(): Value 'False' of argument 'value' is not supported in C:\test.exe on line 76, column 2.
So, okay, that means I absolutely have to validate SSL? Sure, fine. So I found a certificate store on cURL's website, downloaded it, and changed my line above to the following:
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
curl_setopt($ch, CURLOPT_CAINFO, realpath(getcwd() . '/cacert.pem'));
Now when I compile it and run the executable, I get this warning instead:
Value 'CURLOPT_CAINFO' of argument 'option' is not supported in C:\test.exe on line 77, column 2.
It seems I just can't win. How can I get cURL working through PHP compiled by Phalanger, over HTTPS?