Closed ihoneysec closed 5 years ago
我又换了一台Windows7,Python3.5.3,浏览器是可以正常访问这个HTTPS站的,但是使用hh = hack.http(url)
还是会报错:
报错信息: `C:\Users\Administrator>python3.5 Python 3.5.3 (v3.5.3:1880cb95a742, Jan 16 2017, 16:02:32) [MSC v.1900 64 bit (AM D64)] on win32 Type "help", "copyright", "credits" or "license" for more information.
hack = HackRequests.hackRequests() Traceback (most recent call last): File "
", line 1, in NameError: name 'HackRequests' is not defined import HackRequests hack = HackRequests.hackRequests() url = 'https://www.51oz.com' hh = hack.http(url) Traceback (most recent call last): File " ", line 1, in File "C:\Users\Administrator\AppData\Local\Programs\Python\Python35\lib\site-packages\ HackRequests\HackRequests.py", line 308, in http conn.request(method, path, post, tmp_headers) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python35\lib\http\client.py ", line 1107, in request self._send_request(method, url, body, headers) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python35\lib\http\client.py ", line 1152, in _send_request self.endheaders(body) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python35\lib\http\client.py ", line 1103, in endheaders self._send_output(message_body) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python35\lib\site-packages\ HackRequests\HackRequests.py", line 142, in _send_output_hook oldfun(*args, **kwargs) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python35\lib\http\client.py ", line 934, in _send_output self.send(msg) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python35\lib\http\client.py ", line 877, in send self.connect() File "C:\Users\Administrator\AppData\Local\Programs\Python\Python35\lib\http\client.py ", line 1261, in connect server_hostname=server_hostname) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python35\lib\ssl.py", line 385, in wrap_socket _context=self) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python35\lib\ssl.py", line 760, in init self.do_handshake() File "C:\Users\Administrator\AppData\Local\Programs\Python\Python35\lib\ssl.py", line 996, in do_handshake self._sslobj.do_handshake() File "C:\Users\Administrator\AppData\Local\Programs\Python\Python35\lib\ssl.py", line 641, in do_handshake self._sslobj.do_handshake() ConnectionResetError: [WinError 10054] 远程主机强迫关闭了一个现有的连接。
了解,这段时间太忙了,抽空修复
这个问题我在Windows下测试是没有的,但在新安装的Centos7.6系统上使用HackRequests请求HTTPS网站就会抛异常提示链接被重置,Openssl相关的包已经安装过了,不知道是不是只有我一个遇到这个问题,麻烦w8ay表哥看一下。 论坛发你短消息一个星期了没回复,所以发到这里了。 CentOs7.6 Python3.7.3
Centos7.6系统在 hh = hack.http(url) 这一步发生了链接被重置的异常,这个测试的HTTPS站点我的服务器使用curl -i -k和requests库都是可以正常访问的。
报错如下: `]# python3.7 Python 3.7.3 (default, May 6 2019, 03:47:41) [GCC 4.8.5 20150623 (Red Hat 4.8.5-36)] on linux Type "help", "copyright", "credits" or "license" for more information.
Windows下测试HTTP和HTTPS站点都是正常的: `