我在我的AppEngine项目中集成了paypalrestsdk。当,使用我的本地dev_appserver,我尝试创建的PayPal沙箱中的付款,我有以下错误:AppEngine Paypal集成在本地主机上给SSLCertificateError,使用Python
SSLCertificateError: Invalid and/or missing SSL certificate for URL: https://api.sandbox.paypal.com/v1/oauth2/token
所以,我试图提供正确的PEM文件,从here下载它,并建立正确的ssl_option
属性:
# Setting up the correct path to the .pem file
cert = os.path.join(ROOT, 'certs/api.sandbox.paypal.com_SHA-2_01132018.pem')
logger.info("Using SSL certificate: %s", cert)
return Api(
mode=get_paypal_environment(), # sandbox or live
client_id=flask.current_app.config["PAYPAL_CLIENT_ID"],
client_secret=flask.current_app.config["PAYPAL_CLIENT_SECRET"],
ssl_options={"cert": cert}
)
Here存在PayPalRestSDK文件是对如何提供证书的详细信息。我已经仔细检查了创建的路径是否正确。
我发现了一个有关类似问题的错误报告here。
此外,我已经尝试了解决方案建议here仍然无法正常工作。
在实例上,在appspot上,这一切都很完美。
这里是我的requirements.txt的相关部分:
Flask==0.10.1
itsdangerous==0.24
paramiko==1.15.1
pycrypto==2.6.1
Flask-OAuthlib==0.9.1
google-api-python-client==1.4.0
paypalrestsdk==1.11.1
requests[security]==2.9.1
是具有相同问题的人?
我遇到同样的问题。它绝对用于在我的设置中工作,并且我没有改变任何在我的代码区域打破它。 – Codiak