使用YouTube API v3时遇到SSL错误
youtube = build(YOUTUBE_API_SERVICE_NAME, YOUTUBE_API_VERSION, developerKey=DEVELOPER_KEY)
我尝试使用下面的行,但它没有帮助
ssl._create_default_https_context = ssl._create_unverified_context
我的错误:
/usr/lib/python3.5/ssl.py in do_handshake(self, block)
986 if timeout == 0.0 and block:
987 self.settimeout(None)
--> 988 self._sslobj.do_handshake()
989 finally:
990 self.settimeout(timeout)
/usr/lib/python3.5/ssl.py in do_handshake(self)
631 def do_handshake(self):
632 """Start the SSL/TLS handshake."""
--> 633 self._sslobj.do_handshake()
634 if self.context.check_hostname:
635 if not self.server_hostname:
SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:645)
如何将SSL设置为以下内容:此YouTube v3 API的no-check-certificate?