jnbt / candy_check

Check and verify in-app receipts
MIT License
126 stars 70 forks source link

Errno::ECONNRESET (Connection reset by peer - SSL_connect): #47

Closed StevenHarlow closed 4 years ago

StevenHarlow commented 4 years ago

I'm getting a Connection reset by peer when running verify_subscription

      verifier = CandyCheck::AppStore::Verifier.new(config)
      secret = Rails.application.credentials.appstore_secret
      verifier.verify_subscription(receipt_data, secret)
StevenHarlow commented 4 years ago

This is happening in the sandbox environment for the app store. Any thoughts on what might be happening?

maxencehenneron commented 4 years ago

I have the same issue, and there's nothing we can do about it, the appstore sandbox is just extremely buggy. Just resend the request until it is accepted. In production, with real credit card, it works all the time

jnbt commented 4 years ago

I can confirm this observations. The sandbox is very unreliable. But even for production the application should handle these scenarios, because there might be a network failure.

What we're typically are doing is to but these kind of verifications into a queue or asynchronous task, which can be restarted with some exponential backoff algorithm.