aporat / store-receipt-validator

PHP receipt validator for Apple iTunes, Google Play and Amazon App Store
Apache License 2.0
633 stars 153 forks source link

Set TLS version 1.2 on cURL POST request #113

Closed santilorenzo closed 4 years ago

santilorenzo commented 4 years ago

This edit prevents the following error during the cURL POST request: Apple validation request failed: cURL error 35: Unknown SSL protocol error in connection to sandbox.itunes.apple.com:443 (see https://curl.haxx.se/libcurl/c/libcurl-errors.html)

santilorenzo commented 4 years ago

Thank you @Stafox I didn't notice that method. I'll try to use it and see if if works.

exzachlyvv commented 4 years ago

I'm running into this same issue. Any progress here? @santilorenzo do you know if this error will occur in Apple production validation?

aporat commented 4 years ago

Can you provide which php version and which curl library version (curl_version()) you are seeming this issue? doesn't seem to be effected on PHP 7.3.15 with curl 7.61

exzachlyvv commented 4 years ago

I am seeing this with curl version 7.61.1 and php 7.2.13.

Important to note that this error doesn't come through consistently.

And to be clear, my exact error is

cURL error 35: OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to sandbox.itunes.apple.com:443 (see https://curl.haxx.se/libcurl/c/libcurl-errors.html)

aporat commented 4 years ago

@zachvv11 Thanks. I read some reports apple's itunes sandbox is a little unstable these days, so SSL_ERROR_SYSCALL is probably related to that issue and different from the ssl protocol error above.

exzachlyvv commented 4 years ago

Great, thanks for the info. @aporat we will be moving this over to a production environment tomorrow. I'll let you know if we see any issues outside of the sandbox. Appreciate the quick responses.

Stafox commented 4 years ago

@zachvv11 just for info. Time to time you will get errors from Apple api: ssl errors, timeouts, 5xx errors, 21xxx errors in both envs production and sandbox. So, you should make retry logic.

I’ve experienced this while validate 8.5m receipts every 16 hours. So, in my case I’ve such errors every day.

exzachlyvv commented 4 years ago

Good to know thanks @Stafox