python - ssl ,urllib3,requests .exceptions.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:548) -
i'm developing application collects information youtube via youtube apiv3. i'm using yapi package github. working in python2.7 , worked fine.
but when upgraded python 3.3 gave me certificate error.
input
import yapi youtube = yapi.youtubeapi('api key') results = youtube.general_search('keyword', max_results=10) print(results)
output
traceback (most recent call last): file "c:\python33\lib\site-packages\urllib3\connectionpool.py", line 600, in urlopen chunked=chunked) file "c:\python33\lib\site-packages\urllib3\connectionpool.py", line 345, in _make_request self._validate_conn(conn) file "c:\python33\lib\site-packages\urllib3\connectionpool.py", line 844, in _validate_conn conn.connect() file "c:\python33\lib\site-packages\urllib3\connection.py", line 326, in connect ssl_context=context) file "c:\python33\lib\site-packages\urllib3\util\ssl_.py", line 325, in ssl_wrap_socket return context.wrap_socket(sock, server_hostname=server_hostname) file "c:\python33\lib\ssl.py", line 246, in wrap_socket _context=self) file "c:\python33\lib\ssl.py", line 350, in __init__ raise x file "c:\python33\lib\ssl.py", line 346, in __init__ self.do_handshake() file "c:\python33\lib\ssl.py", line 553, in do_handshake self._sslobj.do_handshake() ssl.sslerror: [ssl: certificate_verify_failed] certificate verify failed (_ssl.c:548) during handling of above exception, exception occurred: traceback (most recent call last): file "c:\python33\lib\site-packages\requests\adapters.py", line 440, in send timeout=timeout file "c:\python33\lib\site-packages\urllib3\connectionpool.py", line 630, in urlopen raise sslerror(e) urllib3.exceptions.sslerror: [ssl: certificate_verify_failed] certificate verify failed (_ssl.c:548) during handling of above exception, exception occurred: traceback (most recent call last): file "c:/users/a227855/pycharmprojects/youtube/search.py", line 3, in <module> results = youtube.general_search('keyword', max_results=10) file "c:\python33\lib\site-packages\yapi.py", line 36, in general_search objects = manager.api_request(api_url, params) file "c:\python33\lib\site-packages\manager.py", line 47, in api_request con = requests.get(req_url) file "c:\python33\lib\site-packages\requests\api.py", line 72, in return request('get', url, params=params, **kwargs) file "c:\python33\lib\site-packages\requests\api.py", line 58, in request return session.request(method=method, url=url, **kwargs) file "c:\python33\lib\site-packages\requests\sessions.py", line 502, in request resp = self.send(prep, **send_kwargs) file "c:\python33\lib\site-packages\requests\sessions.py", line 612, in send r = adapter.send(request, **kwargs) file "c:\python33\lib\site-packages\requests\adapters.py", line 514, in send raise sslerror(e, request=request) requests.exceptions.sslerror: [ssl: certificate_verify_failed] certificate verify failed (_ssl.c:548) process finished exit code 1
i had change python 3.4 try support other functions using supported 3 , up.
try , change manager.py line 47 from
con = requests.get(req_url)
to
con = requests.get(req_url, verify=false)
there issue ssl certificate.
could related issue having, using requests
library.
Comments
Post a Comment