简体   繁体   English

Python Simple-Salesforce exe的SSL错误

[英]SSL error with Python Simple-Salesforce exe

I am running a query of a Salesforce database in Python with Simple Salesforce. 我正在使用Simple Salesforce在Python中运行Salesforce数据库查询。 It works fine in the development environment, but when I compile it with py2exe and run it in a command prompt, I get an error that I understand may have to do with SSL, but don't know how to solve it. 它在开发环境中可以正常工作,但是当我使用py2exe对其进行编译并在命令提示符下运行它时,我收到一个错误,该错误可能与SSL有关,但不知道如何解决。 I did not include the entire code, but line 11 referred to in the error is sf = Salesforce(username='myusername', password='mypassword', security_token='mytoken') 我没有包含整个代码,但是错误中提到的第11行是sf = Salesforce(username='myusername', password='mypassword', security_token='mytoken')

I tried sf = Salesforce(username='myusername', password='mypassword', security_token='mytoken', verify=False) with no luck 我尝试了sf = Salesforce(username='myusername', password='mypassword', security_token='mytoken', verify=False)没有运气

My code: 我的代码:

from simple_salesforce import Salesforce
sf = Salesforce(username='myusername', password='mypassword', security_token='mytoken')
data = sf.query_all(select id from Case)

My error: 我的错误:

Traceback (most recent call last):
  File "myfile.py", line 11, in <module>
  File "simple_salesforce\api.pyc", line 74, in __init__
  File "simple_salesforce\login.pyc", line 116, in Salesforce login
  File "requests\api.pyc", line 88, in post
  File "requests\api.pyc", line 44, in request
  File "requests\sessions.pyc", line 456, in request
  File "requests\sessions.pyc", line 559, in send
  File "requests\adapters.pyc", line 382, in send
requests.exceptions.SSLError: [Errno 185090050] _ssl.c:344 erroroB084002:x509
certificate routines:X509_load_cert_crl_file:system lib

I hit the same problem and fixed it by adding the Salesforce SSL Cert to the cacert.pem file on my machine. 我遇到了同样的问题,并通过将Salesforce SSL证书添加到我计算机上的cacert.pem文件中来解决。 Cert is accessed from a link on Settings > Develop > API > Client Certificate. 可通过“设置”>“开发”>“ API”>“客户端证书”上的链接访问证书。 http://na16.salesforce.com/soap/cliencert.jsp http://na16.salesforce.com/soap/cliencert.jsp

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM