已有183人关注
报错:ssl.SSLError: [SSL: WRONG_SIGNATURE_TYPE] wrong signature type (_ssl.c:997)
发表在Python图书答疑 2022-12-07 《Python网络爬虫从入门到实践》第3章 请求模块urllib 53页-55页
是否精华
版块置顶:
import urllib.request
import urllib.parse


url = 'https://passport.mingrisoft.com/Login/checkLogin'
headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:107.0) Gecko/20100101 Firefox/107.0'}
data = bytes(urllib.parse.urlencode({'username': 'zhgy', 'password': 'zhgy@1993'}), encoding='utf-8')
req = urllib.request.Request(url=url, data=data, method='POST', unverifiable=False)
response = urllib.request.urlopen(req)
print(response.read().decode())

以上是书中示例3.5的代码,因为书中提供的网址访问不了,所以我就使用了官网网址做测试,但是出现标题中错误

Traceback (most recent call last):
  File "C:\Python\Python3.10.2\lib\urllib\request.py", line 1348, in do_open
    h.request(req.get_method(), req.selector, req.data, headers,
  File "C:\Python\Python3.10.2\lib\http\client.py", line 1282, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "C:\Python\Python3.10.2\lib\http\client.py", line 1328, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "C:\Python\Python3.10.2\lib\http\client.py", line 1277, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "C:\Python\Python3.10.2\lib\http\client.py", line 1037, in _send_output
    self.send(msg)
  File "C:\Python\Python3.10.2\lib\http\client.py", line 975, in send
    self.connect()
  File "C:\Python\Python3.10.2\lib\http\client.py", line 1454, in connect
    self.sock = self._context.wrap_socket(self.sock,
  File "C:\Python\Python3.10.2\lib\ssl.py", line 512, in wrap_socket
    return self.sslsocket_class._create(
  File "C:\Python\Python3.10.2\lib\ssl.py", line 1070, in _create
    self.do_handshake()
  File "C:\Python\Python3.10.2\lib\ssl.py", line 1341, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLError: [SSL: WRONG_SIGNATURE_TYPE] wrong signature type (_ssl.c:997)

分享到:
精彩评论 2
zhgy
学分:26 LV2
2022-12-07
沙发

大神帮看看什么原因导致的

小禾斗
学分:7308 LV13
TA的每日心情
奋斗
2017-04-21 14:00:25
2022-12-08
板凳

尊敬的读者朋友们:

  您好!为了给您提供更好的用户体验,我们近期升级了爬虫测试服务器,新的爬虫测试服务器地址如下:


   1、spacer.gifhttp://test.mingribook.com:666/  替换原  http://site.rjkflm.com:666/


   2、http://test2.mingribook.com:666/  替换原  http://site2.rjkflm.com:666/


   3、http://sck.mingribook.com:666/   替换原  http://sck.rjkflm.com:666/



首页上一页 1 下一页尾页 2 条记录 1/1页
手机同步功能介绍
友情提示:以下图书配套资源能够实现手机同步功能
明日微信公众号
明日之星 明日之星编程特训营
客服热线(每日9:00-17:00)
400 675 1066
mingrisoft@mingrisoft.com
吉林省明日科技有限公司Copyright ©2007-2022,mingrisoft.com, All Rights Reserved长春市北湖科技开发区盛北大街3333号长春北湖科技园项目一期A10号楼四、五层
吉ICP备10002740号-2吉公网安备22010202000132经营性网站备案信息 营业执照