Https urllib.error.urleror:<;urlopen错误[Errno 0]错误>;

Https urllib.error.urleror:<;urlopen错误[Errno 0]错误>;,https,urllib,python-3.7,Https,Urllib,Python 3.7,我使用python3.7.2 urllib请求https url引发错误。如何修复它。多谢各位 如果将https替换为http,则返回ok。但这是需要的 import ssl import urllib.request if __name__ == '__main__': ssl_context = ssl.SSLContext(ssl.PROTOCOL_TLSv1) response = urllib.request.urlopen('https://igionline.co

我使用python3.7.2 urllib请求https url引发错误。如何修复它。多谢各位

如果将https替换为http,则返回ok。但这是需要的

import ssl
import urllib.request

if __name__ == '__main__':
    ssl_context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
    response = urllib.request.urlopen('https://igionline.com/viewpdf.htm?itemno=LG11151502', timeout=10, context=ssl_context)


Traceback (most recent call last):
  File "/home/wmh/Python-3.7.2/Lib/urllib/request.py", line 1317, in do_open
    encode_chunked=req.has_header('Transfer-encoding'))
  File "/home/wmh/Python-3.7.2/Lib/http/client.py", line 1229, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/home/wmh/Python-3.7.2/Lib/http/client.py", line 1275, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/home/wmh/Python-3.7.2/Lib/http/client.py", line 1224, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/home/wmh/Python-3.7.2/Lib/http/client.py", line 1016, in _send_output
    self.send(msg)
  File "/home/wmh/Python-3.7.2/Lib/http/client.py", line 956, in send
    self.connect()
  File "/home/wmh/Python-3.7.2/Lib/http/client.py", line 1392, in connect
    server_hostname=server_hostname)
  File "/home/wmh/Python-3.7.2/Lib/ssl.py", line 412, in wrap_socket
    session=session
  File "/home/wmh/Python-3.7.2/Lib/ssl.py", line 853, in _create
    self.do_handshake()
  File "/home/wmh/Python-3.7.2/Lib/ssl.py", line 1117, in do_handshake
    self._sslobj.do_handshake()
OSError: [Errno 0] Error

我明白了,因为证书是有序的。