lorisleiva / laravel-docker

🐳 Generic docker image for Laravel Applications
MIT License
934 stars 314 forks source link

Question about SSL_ERROR_SYSCALL #5

Closed PhouvanhKCSV closed 5 years ago

PhouvanhKCSV commented 6 years ago

Hi,

When i run unit test which call external API, i got the following error "LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to ......."

Even i use

CURLOPT_SSL_VERIFYHOST => false,
CURLOPT_SSL_VERIFYPEER => false,
CURLOPT_SSL_VERIFYSTATUS => false,

Still not working.

$url = 'APIURL;
$curl = curl_init();

curl_setopt_array($curl, [
    CURLOPT_RETURNTRANSFER => 1,
    CURLOPT_URL => $url,
    CURLOPT_SSL_VERIFYHOST => false,
    CURLOPT_SSL_VERIFYPEER => false,
    CURLOPT_SSL_VERIFYSTATUS => false,
]);

$resp = curl_exec($curl);

if (curl_errno($curl)) {
    dd(curl_error($curl));
}

curl_close($curl);

return json_decode($resp);

When i run test from my local/server it work, but when i run from laravel-docker it does not work, it throw that error

Could someone please help me. Thanks

lorisleiva commented 6 years ago

Hello 👋

It could be that you need the openssl package as a production dependency (see example).

Could you please fork this repository, add the openssl dependency and tell me if this fixes your problem?

If it does I will add it to the master branch. 🙂

PhouvanhKCSV commented 6 years ago

Ok, will let you know

lorisleiva commented 5 years ago

Hi there 👋 Any updates on this issue?

lorisleiva commented 5 years ago

Closed due to inactivity.