连接到Salesforce的Python Beatbox到Salesforce错误

时间:2015-03-02 17:07:24

标签: python-2.7 salesforce beatbox

我刚刚将计算机重新映像并在我的计算机上安装了Python 2.7.9(64位)。使用PIP我安装了beatbox 32.1。

当我拨打电话连接到Salesforce时:

sf_client.login(sf_username, sf_password)
logging.info('Connected successfully')

我收到错误消息。我尝试过一直使用的普通登录凭据,并尝试在密码中连接我的令牌。 有没有人用Python Beatbox遇到这个错误,你知道我可以尝试哪些调试选项到底吗?

Traceback (most recent call last):
File "C:\myCode\salesforceload_beatbox.py", line 126, in <module>
sf_client.login(sf_username, sf_password)
File "C:\Python27\lib\site-packages\beatbox\python_client.py", line 76, in login
res = BaseClient.login(self, username, passwd)
File "C:\Python27\lib\site-packages\beatbox\_beatbox.py", line 62, in login
lr = LoginRequest(self.serverUrl, username, password).post()
File "C:\Python27\lib\site-packages\beatbox\_beatbox.py", line 330, in post
raise RuntimeError('No response from Salesforce')
RuntimeError: No response from Salesforce

在深入研究这个问题之后(以及使用请求包调试HTTP连接),我在这个级别失败了

Traceback (most recent call last):
File "C:\myCode\SFDC\test_beatbox_call2.py", line 34, in <module>
requests.get(sf_client.login(sf_username, sf_password))
File "C:\Python27\lib\site-packages\beatbox\python_client.py", line 76, in login
res = BaseClient.login(self, username, passwd)
File "C:\Python27\lib\site-packages\beatbox\_beatbox.py", line 78, in login
lr = LoginRequest(self.serverUrl, username, password).post()
File "C:\Python27\lib\site-packages\beatbox\_beatbox.py", line 344, in post
conn.request("POST", path, self.makeEnvelope(), headers)
File "C:\Python27\lib\httplib.py", line 1001, in request
self._send_request(method, url, body, headers)
File "C:\Python27\lib\httplib.py", line 1035, in _send_request
self.endheaders(body)
File "C:\Python27\lib\httplib.py", line 997, in endheaders
self._send_output(message_body)
File "C:\Python27\lib\httplib.py", line 850, in _send_output
self.send(msg)
File "C:\Python27\lib\httplib.py", line 812, in send
self.connect()
File "C:\Python27\lib\httplib.py", line 1216, in connect
server_hostname=server_hostname)
File "C:\Python27\lib\ssl.py", line 350, in wrap_socket
_context=self)
File "C:\Python27\lib\ssl.py", line 566, in __init__
self.do_handshake()
File "C:\Python27\lib\ssl.py", line 788, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581)

1 个答案:

答案 0 :(得分:1)

在搜索和搜索大量关于TLS连接等之后,我注意到本周末我的cmd.exe窗口(我运行PIP命令)是在C:\ Windows \ System32&gt;下启动的。我的所有虚拟机都在我的个人用户目录中启动。 所以我搜索了我的漫游cmd.exe,当我打开它时,它是我的个人用户目录。 在新的cmd.exe中使用PIP卸载并安装beatbox后,通过Beatbox的所有Salesforce调用都像以前一样工作。 现在我无法完全解释为什么会出现这种情况,但有些事情告诉我这个管理员位置的证书可能与我的个人证书不匹配。我重新开始跑步了。