1

我刚刚对我的计算机进行了重新映像,并在我的计算机上安装了 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

在深入研究之后(并使用 requests 包调试 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)
4

1 回答 1

1

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

于 2015-03-09T21:31:59.867 回答