Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Joshuyo's avatar

cURL error 56: OpenSSL SSL_read: error:0A000126:SSL routines::unexpected eof while reading

Dear All; On a fresh Ubuntu 22.04 installation, when I run the following code on Laravel 10:

Http::get('https://seffaflik.epias.com.tr/transparency/service/market/mcp-smp', [
         'startDate' => '2023-03-16',
         'endDate' => '2023-03-24',
     ]);

receiving the following error:

 GuzzleHttp\Exception\RequestException  cURL error 56: OpenSSL SSL_read: error:0A000126:SSL routines::unexpected eof while reading, errno 0 (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://seffaflik.epias.com.tr/transparency/service/market/mcp-smp?startDate=2023-03-16&endDate=2023-03-24.

However, if I curl it I am getting a response:

curl "https://seffaflik.epias.com.tr/transparency/service/market/mcp-smp?startDate=2023-03-16&endDate=2023-03-24"
{"resultCode":"0","resultDescription":"success","body":{"mcpSmps":[{"date":"2023-03-16T00:00:00.000+0300","mcp":2000,"smp":2000,"smpDirection":"ENERGY_DEFICIT","mcpState":"FINAL"},{"date":"2023-03-16T01:00:00.000+0300","mcp":2195,"smp":2195,"smpDirection":"ENERGY_DEFICIT","mcpState":"FINAL"},{"date":"2023-03-16T02:00:00.000+0300","mcp":1740,"smp":1740,"smpDirection":"ENERGY_DEFICIT","mcpState":"FINAL"},{"date":"2023-03-16T03:00:00.000+0300","mcp":1599.99,"smp":1650,"smpDirection" ...

To be honest it all started as :

curl: (35) error:0A000152:SSL routines::unsafe legacy renegotiation disabled

problem and I fixed it by adding:

[system_default_sect]
Options = UnsafeLegacyRenegotiation
CipherString = DEFAULT:@SECLEVEL=0
MinProtocol = TLSv1.1

in openssl.cnf considering the fact that everything will be ok. However I ended up having more ugly problem which is cURL error 56. Any guidance will be appreciated...

0 likes
1 reply

Please or to participate in this conversation.