Can't make PHP get request anymore

Shopify Partner
38 0 1

Hi all,

I have some webhooks and scripts which run on cron jobs for our shop, which have been working fine for a couple of years but since a little while stopped working.

I traced the error and found out it came to this:

$orders = json_decode(file_get_contents($baseUrl.'orders.json'), true);

... used to work, but now throws this error:

Warning: file_get_contents(): SSL: Connection reset by peer in /xxx/scripts/xxx.php on line 20

Warning: file_get_contents(): Failed to enable crypto in /xxx/scripts/xxx.php on line 20

Warning: file_get_contents(https://...@seres-collection.myshopify.com/admin/orders.json): failed to open stream: operation failed in ...

Searching the forum for security updates I found a possible cause for this: https://ecommerce.shopify.com/c/api-announcements/t/shopify-is-deprecating-its-support-of-tls-1-0-an...

Can someone confirm that and clarify what the exact problem and solution in my case might be?

Freelance developer – http://tomkeysers.be
0 Likes
Highlighted
Shopify Staff
Shopify Staff
1555 81 284

That sounds to me like you're using a deprecated version of TLS as the forum post implies. Only you can determine that for sure with the information available in this post.

Are you able to follow the PHP-specific guidelines here? https://civicrm.org/blog/yashodha/are-you-ready-for-tls-12-update-cant-escape-it

I don't know enough about PHP to be of much assistance here.

2 Likes
Highlighted
Shopify Partner
38 0 1

Thanks for pointing in the right direction, Alex!

It turned out that the environment of my host was configured to use an old – not TLS1.2 compatible – Openssl library. Changed that and it's working again!

Freelance developer – http://tomkeysers.be
1 Like
Highlighted
Shopify Partner
14 0 0

Hello Alex,

My API's stopped working suddenly Yesterday.

 

It is throwing errors like this:

Uncaught ShopifyCurlException: OpenSSL SSL_read: Connection reset by peer.
"OpenSSL SSL_read: Connection reset by peer"
"OpenSSL SSL_connect: Connection reset by peer in connection"

 

I tested TLS version on my server from https://www.ssllabs.com/ssltest/analyze.html?d=webappslive.com

It is showing the message that "This server supports TLS 1.3."

I checked the API Announcements link https://ecommerce.shopify.com/c/api-announcements/t/shopify-is-deprecating-its-support-of-tls-1-0-an... and in that post Ryan had told that we need to upgrade TLS version to 1.2.

But my server is supporting TLS 1.3. So do we need to have exact TLS 1.2 or we need to have TLS 1.2 or above?

Thank you for helping
Best Regards

0 Likes