【发布时间】:2015-09-12 18:55:28
【问题描述】:
从 python 连接到任何站点时出现套接字错误。但是,当我使用 curl 对 -k 执行相同操作时,我可以连接。我是 python 新手,如何在 python 中禁用 ssl 验证器?对我来说,这似乎与 ssl 有关。这是我在这里提出的 https 请求。
>>> sock.bind(server_address)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python27\lib\socket.py", line 228, in meth
return getattr(self._sock,name)(*args)
socket.gaierror: [Errno 11001] getaddrinfo failed
【问题讨论】:
-
import socket;socket.getaddrinfo('the url you are trying to get', 443)是做什么的?我在本地尝试过,但出现错误,除非我删除 http:// 或 https://
标签: python python-2.7 curl websocket