This is not related to homestead
nor vagrant
nor laravel
.
I have an app service running on PHP
7.3 on a Windows Azure server.
Here's the code I'm running in relation to my cURL
call:
$resCurl = curl_init();
$url_API = 'https://example.com/api/someMethod';
curl_setopt( $resCurl, CURLOPT_HTTPHEADER, array( 'Content-type: APPLICATION/JSON; CHARSET=UTF-8' ) );
curl_setopt( $resCurl, CURLOPT_POSTFIELDS, $jsonRequest );
curl_setopt( $resCurl, CURLOPT_POST, true );
curl_setopt( $resCurl, CURLOPT_URL, $url_API );
curl_setopt( $resCurl, CURLOPT_RETURNTRANSFER, 1);
$resultAPI = curl_exec( $resCurl );
When this is executed, I keep on generating this error:
Curl error: OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 10054
Running the command prompt, I can execute php -i
to see if openssl
has a directory it's reading from as well a file mentioned:
I've already checked the directory and downloaded the most up-to-date cacert.pem
file from here: https://curl.haxx.se/docs/sslcerts.html
I DO NOT want to solve this issue through turning off SSL verification by setting my CURLOPT_SSL_VERIFYHOST
and CURLOPT_SSL_VERIFYPEER
to false.
Any advice?
UPDATE:
I hardcoded options for both CURLOPT_SSLCERT
and CURLOPT_SSLCERTTYPE
:
curl_setopt( $resCurl, CURLOPT_SSLCERT, 'D:\home\site\cert\cacert.pem');
curl_setopt( $resCurl, CURLOPT_SSLCERTTYPE, 'PEM' );
And the error is different now:
unable to set private key file: 'D:\home\site\cert\cacert.pem' type PEM
I would upload a private key, but there are no private keys for this public cacert.