0

I am dealing with the following error

Traceback (most recent call last):
  File "once.py", line 1757, in <module>
    once()
  File "once.py", line 55, in once
stripe.Charge.all()
  File "/Library/Python/2.7/site-packages/stripe/resource.py", line 438, in all
return cls.list(*args, **params)
  File "/Library/Python/2.7/site-packages/stripe/resource.py", line 450, in list
response, api_key = requestor.request('get', url, params)
  File "/Library/Python/2.7/site-packages/stripe/api_requestor.py", line 150, in request
method.lower(), url, params, headers)
  File "/Library/Python/2.7/site-packages/stripe/api_requestor.py", line 281, in request_raw
method, abs_url, headers, post_data)
  File "/Library/Python/2.7/site-packages/stripe/http_client.py", line 139, in request
self._handle_request_error(e)
  File "/Library/Python/2.7/site-packages/stripe/http_client.py", line 159, in _handle_request_error
raise error.APIConnectionError(msg)
stripe.error.APIConnectionError: Unexpected error communicating with Stripe.  If this problem persists,
let us know at support@stripe.com.

I get this error when running a simple test program which stripe suggested

import stripe
stripe.api_key = "blah bla"
stripe.api_base = "https://api-tls12.stripe.com"

print "stripe.VERSION = ", stripe.VERSION
if stripe.VERSION in ("1.13.0", "1.14.0", "1.14.1", "1.15.1", "1.16.0", "1.17.0", "1.18.0", "1.19.0"):
    print "Bindings update required."

try:
    stripe.Charge.all()
    print "TLS 1.2 supported, no action required."
except stripe.error.APIConnectionError:
    print "TLS 1.2 is not supported. You will need to upgrade your integration."
    raise

I do not understand why I get this error, since my stripe version is high enough

stripe.VERSION =  1.55.2

and my openssl version does support TLS?

>>$ openssl version
OpenSSL 1.0.2k  26 Jan 2017
>>$ which openssl
/usr/bin/openssl

any ideas how to debug this further? I am lost...

jww
  • 97,681
  • 90
  • 411
  • 885
carl
  • 4,216
  • 9
  • 55
  • 103

1 Answers1

1

ok I don't know what exactly caused the problem, but I got it working by changing the client

client = stripe.http_client.PycurlClient()
stripe.default_http_client = client

I think the requests package is the default. pycurl seems to work in my case...

carl
  • 4,216
  • 9
  • 55
  • 103