A script to download materials from the FutureLearn website (for enrolled courses)
GNU General Public License v3.0
34
stars
20
forks
source link
SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)'))) #16
I am getting the following SSL certificate-related error despite the proper certificates are installed
$ pip install --upgrade certifi
Defaulting to user installation because normal site-packages is not writeable
Requirement already up-to-date: certifi in /usr/lib/python3.8/site-packages (2020.4.5.1)
Traceback (most recent call last):
File "/usr/lib/python3.8/site-packages/urllib3/connectionpool.py", line 665, in urlopen
httplib_response = self._make_request(
File "/usr/lib/python3.8/site-packages/urllib3/connectionpool.py", line 376, in _make_request
self._validate_conn(conn)
File "/usr/lib/python3.8/site-packages/urllib3/connectionpool.py", line 994, in _validate_conn
conn.connect()
File "/usr/lib/python3.8/site-packages/urllib3/connection.py", line 352, in connect
self.sock = ssl_wrap_socket(
File "/usr/lib/python3.8/site-packages/urllib3/util/ssl_.py", line 370, in ssl_wrap_socket
return context.wrap_socket(sock, server_hostname=server_hostname)
File "/usr/lib/python3.8/ssl.py", line 500, in wrap_socket
return self.sslsocket_class._create(
File "/usr/lib/python3.8/ssl.py", line 1040, in _create
self.do_handshake()
File "/usr/lib/python3.8/ssl.py", line 1309, in do_handshake
self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.8/site-packages/requests/adapters.py", line 439, in send
resp = conn.urlopen(
File "/usr/lib/python3.8/site-packages/urllib3/connectionpool.py", line 719, in urlopen
retries = retries.increment(
File "/usr/lib/python3.8/site-packages/urllib3/util/retry.py", line 436, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='elearning.rcgp.org.uk', port=443): Max retries exceeded with url: /pluginfile.php/148915/mod_resource/content/3/NHS_VC_Info%20for%20GPs_v06.pdf (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)')))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "./futurelearn-dl.py", line 625, in <module>
getCourseWeekStepPage(course_id, week_id, step_id, week_num, title)
File "./futurelearn-dl.py", line 232, in getCourseWeekStepPage
downloadURLsInPage(course_id, week_id, step_id, week_num, content, DOWNLOAD_TYPE, page_title)
File "./futurelearn-dl.py", line 386, in downloadURLsInPage
downloadURLInPage(url, download_dir, DOWNLOAD_TYPE, page_title)
File "./futurelearn-dl.py", line 452, in downloadURLInPage
downloadURLToFile(url, ofile, DOWNLOAD_TYPE)
File "./futurelearn-dl.py", line 405, in downloadURLToFile
response = session.get(url, headers=headers)
File "/usr/lib/python3.8/site-packages/requests/sessions.py", line 543, in get
return self.request('GET', url, **kwargs)
File "/usr/lib/python3.8/site-packages/requests/sessions.py", line 530, in request
resp = self.send(prep, **send_kwargs)
File "/usr/lib/python3.8/site-packages/requests/sessions.py", line 643, in send
r = adapter.send(request, **kwargs)
File "/usr/lib/python3.8/site-packages/requests/adapters.py", line 514, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='elearning.rcgp.org.uk', port=443): Max retries exceeded with url: /pluginfile.php/148915/mod_resource/content/3/NHS_VC_Info%20for%20GPs_v06.pdf (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)')))
I have also tried singular certificate, but with the same SSL verification error getting recorded:
Hi,
I am getting the following SSL certificate-related error despite the proper certificates are installed
I have also tried singular certificate, but with the same SSL verification error getting recorded:
Any input?
Cheers, and stay safe, /z