The use of Braintree SDK under my local dev_appserver.py
is returning following error on braintree.ClientToken.generate()
:
SSLError: SSLCertificateError:
Invalid and/or missing SSL certificate for URL:
https://api.sandbox.braintreegateway.com:443/merchants/<merchant_id>/client_token
I am using the requests_toolbelt
at the start of my server:
# Make requests work in GAE
import requests
from requests_toolbelt.adapters import appengine
appengine.monkeypatch()
Explicitly excluding SSL Validation doesn't work either (returns with the same error message):
appengine.monkeypatch(validate_certificate=False)
In fact, without requests_toolbelt
, the error I get when calling .generate()
is:
ProtocolError('Connection aborted.', error(13, 'Permission denied'))
I also tried the hack in the main.py
of braintree-python-appengine project but I get the same SSL error message back.
My dev environment:
- MacOSX 10.11.6
- gcloud app Python Extensions 1.9.63
- Python 2.7.10
- requests==2.18.4
- braintree==3.39.0
- Flask==0.12.2
Note:
- Once deployed to Google App Engine, I get the client token back without any problem
- Directly use of
requests
onhttps://www.braintreepayments.com/
returns 200 without any errors