دعم الموقع

I am attempting to download from the database in bulk and received the following error after several hundred movies:

SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:645)

I could turn off verify for requests , but is there any reason on the API/website side why this would happen?

6 ردود (على هذه الصفحة 1 من 1)

Jump to last post

but is there any reason on the API/website side why this would happen?

No, but what server is error'ing (is it api.themoviedb.org or image.tmdb.org?) and what's the full error message and request/response headers of a request that is failing?

Should be the api.themoviedb.org. It was suggested to me that has actually something to do with the rate limit, but pasted below is the full error message.

SSLError                                  Traceback (most recent call last)
C:\Users\user\AppData\Local\Continuum\Anaconda3\lib\site-packages\requests\packages\urllib3\connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, **response_kw)
    594                                                   body=body, headers=headers,
--> 595                                                   chunked=chunked)
    596 

C:\Users\user\AppData\Local\Continuum\Anaconda3\lib\site-packages\requests\packages\urllib3\connectionpool.py in _make_request(self, conn, method, url, timeout, chunked, **httplib_request_kw)
    351         try:
--> 352             self._validate_conn(conn)
    353         except (SocketTimeout, BaseSSLError) as e:

C:\Users\user\AppData\Local\Continuum\Anaconda3\lib\site-packages\requests\packages\urllib3\connectionpool.py in _validate_conn(self, conn)
    830         if not getattr(conn, 'sock', None):  # AppEngine might not have  `.sock`
--> 831             conn.connect()
    832 

C:\Users\user\AppData\Local\Continuum\Anaconda3\lib\site-packages\requests\packages\urllib3\connection.py in connect(self)
    288                                     server_hostname=hostname,
--> 289                                     ssl_version=resolved_ssl_version)
    290 

C:\Users\user\AppData\Local\Continuum\Anaconda3\lib\site-packages\requests\packages\urllib3\util\ssl_.py in ssl_wrap_socket(sock, keyfile, certfile, cert_reqs, ca_certs, server_hostname, ssl_version, ciphers, ssl_context, ca_cert_dir)
    307     if HAS_SNI:  # Platform-specific: OpenSSL with enabled SNI
--> 308         return context.wrap_socket(sock, server_hostname=server_hostname)
    309 

C:\Users\user\AppData\Local\Continuum\Anaconda3\lib\ssl.py in wrap_socket(self, sock, server_side, do_handshake_on_connect, suppress_ragged_eofs, server_hostname)
    376                          server_hostname=server_hostname,
--> 377                          _context=self)
    378 

C:\Users\user\AppData\Local\Continuum\Anaconda3\lib\ssl.py in __init__(self, sock, keyfile, certfile, server_side, cert_reqs, ssl_version, ca_certs, do_handshake_on_connect, family, type, proto, fileno, suppress_ragged_eofs, npn_protocols, ciphers, server_hostname, _context)
    751                         raise ValueError("do_handshake_on_connect should not be specified for non-blocking sockets")
--> 752                     self.do_handshake()
    753 

C:\Users\user\AppData\Local\Continuum\Anaconda3\lib\ssl.py in do_handshake(self, block)
    987                 self.settimeout(None)
--> 988             self._sslobj.do_handshake()
    989         finally:

C:\Users\user\AppData\Local\Continuum\Anaconda3\lib\ssl.py in do_handshake(self)
    632         """Start the SSL/TLS handshake."""
--> 633         self._sslobj.do_handshake()
    634         if self.context.check_hostname:

SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:645)

During handling of the above exception, another exception occurred:

SSLError                                  Traceback (most recent call last)
C:\Users\user\AppData\Local\Continuum\Anaconda3\lib\site-packages\requests\adapters.py in send(self, request, stream, timeout, verify, cert, proxies)
    422                     retries=self.max_retries,
--> 423                     timeout=timeout
    424                 )

C:\Users\user\AppData\Local\Continuum\Anaconda3\lib\site-packages\requests\packages\urllib3\connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, **response_kw)
    620             clean_exit = False
--> 621             raise SSLError(e)
    622 

SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:645)

During handling of the above exception, another exception occurred:

SSLError                                  Traceback (most recent call last)
<ipython-input-5-d1af498117a6> in <module>()
     11         url = 'https://api.themoviedb.org/3/movie/{id}?api_key=a792ae6c41aa660a503fb1c835a3daa7&language=en-US'.format(id=i)
     12         payload = "{}"
---> 13         response = requests.request("GET", url, data=payload)
     14         print(response)
     15         if '404' in response:

C:\Users\user\AppData\Local\Continuum\Anaconda3\lib\site-packages\requests\api.py in request(method, url, **kwargs)
     54     # cases, and look like a memory leak in others.
     55     with sessions.Session() as session:
---> 56         return session.request(method=method, url=url, **kwargs)
     57 
     58 

C:\Users\user\AppData\Local\Continuum\Anaconda3\lib\site-packages\requests\sessions.py in request(self, method, url, params, data, headers, cookies, files, auth, timeout, allow_redirects, proxies, hooks, stream, verify, cert, json)
    473         }
    474         send_kwargs.update(settings)
--> 475         resp = self.send(prep, **send_kwargs)
    476 
    477         return resp

C:\Users\user\AppData\Local\Continuum\Anaconda3\lib\site-packages\requests\sessions.py in send(self, request, **kwargs)
    594 
    595         # Send the request
--> 596         r = adapter.send(request, **kwargs)
    597 
    598         # Total elapsed time of the request (approximately)

C:\Users\user\AppData\Local\Continuum\Anaconda3\lib\site-packages\requests\adapters.py in send(self, request, stream, timeout, verify, cert, proxies)
    495         except (_SSLError, _HTTPError) as e:
    496             if isinstance(e, _SSLError):
--> 497                 raise SSLError(e, request=request)
    498             elif isinstance(e, ReadTimeoutError):
    499                 raise ReadTimeout(e, request=request)

SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:645)

Hi there, ya I'm not sure. I don't have any Python experience so I can't really even troubleshoot much of that.

I know our SSL validates properly, you can see that here. There's a number of Python libraries that I know work for a lot of people, you could compare what you're doing with them.

FYI, it does seem to be a rate limiting issue. It triggers the 423 error (though I'm not sure why this is an SSL certificate error). I am going to have to put some form of limitation in.

The only rate limit error we publish is a 429. Is that what you meant? It's still served via the same HTTPS connection though, so if that's what you meant, then perhaps something is being triggered with the HTTP lib you are using.

Yes, I mean 429. I will look into this and post something here for future readers if I can figure it out.

لم تجد الفلم أو المسلسل ؟ سجل دخولك و انشئها

عام

s ركز شريط البحث
p افتح قائمة الملف الشخصي
esc اغلق النافذة المفتوحة
? افتح نافذة اختصارات لوحة المفاتيح

على كافة صفحات الوسائط

b ارجع للخلف (او للصفحة الام عند التطبيق)
e انتقل لصفحة التعديل

على كافة صفحات موسم المسلسل

(السهم الايمن) انتقل للموسم التالي
(السهم الايسر) انتقل للموسم السابق

على كافة صفحات حلقة المسلسل

(السهم الايمن) انتقل للحلقة التالية
(السهم الايسر) انتقل للحلقة السابقة

على كافة صفحات الصور

a افتح صفحة اضافة الصورة

على كافة صفحات التعديل

t افتح محدد الترجمة
ctrl+ s ارسال النموذج

على صفحات المناقشة

n انشى نقاش جديد
w تبديل حالة المتابعة
p تبديل عام / خاص
c تبديل اغلاق / فتح
a افتح الانشطة
r رد على النقاش
l انتقل لأخر رد
ctrl+ enter أرسل رسالتك
(السهم الايمن) الصفحة التالية
(السهم الايسر) الصفحة السابقة

الاعدادات

هل تريد تقييم او اضافة هذا العنصر للقائمة؟

تسجيل الدخول