PDF build: SSL errors, 'certificate verify failed'
See original GitHub issueHi. I’m just working through the documentation. Followed all the installation instructions. Trying to build the example mini_book
as a PDF on Ubuntu:
(qe-mini-example) ~/quantecon-mini-example$ jupyter-book build ./mini_book --builder pdfhtml
Running Sphinx v2.4.4
loading pickled environment... done
building [mo]: targets for 0 po files that are out of date
building [singlehtml]: all documents
updating environment: 0 added, 0 changed, 0 removed
looking for now-outdated files... none found
preparing documents... done
assembling single document... docs/about_py docs/getting_started docs/python_by_example docs/learn_more done
writing... done
writing additional files... done
copying images... [100%] _static/lecture_specific/about_py/career_vf.png
copying static files... ... done
copying extra files... done
dumping object inventory... done
build succeeded.
The HTML page is in mini_book/_build/html.
Finished generating HTML for book...
Converting book HTML into PDF...
[W:pyppeteer.chromium_downloader] start chromium download.
Download may take a few minutes.
Traceback (most recent call last):
File "/home/shawley/anaconda3/envs/qe-mini-example/lib/python3.7/site-packages/urllib3/contrib/pyopenssl.py", line 488, in wrap_socket
cnx.do_handshake()
File "/home/shawley/anaconda3/envs/qe-mini-example/lib/python3.7/site-packages/OpenSSL/SSL.py", line 1934, in do_handshake
self._raise_ssl_error(self._ssl, result)
File "/home/shawley/anaconda3/envs/qe-mini-example/lib/python3.7/site-packages/OpenSSL/SSL.py", line 1671, in _raise_ssl_error
_raise_current_error()
File "/home/shawley/anaconda3/envs/qe-mini-example/lib/python3.7/site-packages/OpenSSL/_util.py", line 54, in exception_from_error_queue
raise exception_type(errors)
OpenSSL.SSL.Error: [('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')]
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/shawley/anaconda3/envs/qe-mini-example/lib/python3.7/site-packages/urllib3/connectionpool.py", line 677, in urlopen
chunked=chunked,
File "/home/shawley/anaconda3/envs/qe-mini-example/lib/python3.7/site-packages/urllib3/connectionpool.py", line 381, in _make_request
self._validate_conn(conn)
File "/home/shawley/anaconda3/envs/qe-mini-example/lib/python3.7/site-packages/urllib3/connectionpool.py", line 976, in _validate_conn
conn.connect()
File "/home/shawley/anaconda3/envs/qe-mini-example/lib/python3.7/site-packages/urllib3/connection.py", line 370, in connect
ssl_context=context,
File "/home/shawley/anaconda3/envs/qe-mini-example/lib/python3.7/site-packages/urllib3/util/ssl_.py", line 377, in ssl_wrap_socket
return context.wrap_socket(sock, server_hostname=server_hostname)
File "/home/shawley/anaconda3/envs/qe-mini-example/lib/python3.7/site-packages/urllib3/contrib/pyopenssl.py", line 494, in wrap_socket
raise ssl.SSLError("bad handshake: %r" % e)
ssl.SSLError: ("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')])",)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/shawley/anaconda3/envs/qe-mini-example/bin/jupyter-book", line 8, in <module>
sys.exit(main())
File "/home/shawley/anaconda3/envs/qe-mini-example/lib/python3.7/site-packages/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "/home/shawley/anaconda3/envs/qe-mini-example/lib/python3.7/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/home/shawley/anaconda3/envs/qe-mini-example/lib/python3.7/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/shawley/anaconda3/envs/qe-mini-example/lib/python3.7/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/shawley/anaconda3/envs/qe-mini-example/lib/python3.7/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/home/shawley/anaconda3/envs/qe-mini-example/lib/python3.7/site-packages/jupyter_book/commands/__init__.py", line 163, in build
html_to_pdf(OUTPUT_PATH.joinpath("index.html"), path_pdf_output)
File "/home/shawley/anaconda3/envs/qe-mini-example/lib/python3.7/site-packages/jupyter_book/pdf.py", line 19, in html_to_pdf
asyncio.get_event_loop().run_until_complete(_html_to_pdf(html_file, pdf_file))
File "/home/shawley/anaconda3/envs/qe-mini-example/lib/python3.7/asyncio/base_events.py", line 583, in run_until_complete
return future.result()
File "/home/shawley/anaconda3/envs/qe-mini-example/lib/python3.7/site-packages/jupyter_book/pdf.py", line 31, in _html_to_pdf
browser = await launch(args=["--no-sandbox"])
File "/home/shawley/anaconda3/envs/qe-mini-example/lib/python3.7/site-packages/pyppeteer/launcher.py", line 305, in launch
return await Launcher(options, **kwargs).launch()
File "/home/shawley/anaconda3/envs/qe-mini-example/lib/python3.7/site-packages/pyppeteer/launcher.py", line 119, in __init__
download_chromium()
File "/home/shawley/anaconda3/envs/qe-mini-example/lib/python3.7/site-packages/pyppeteer/chromium_downloader.py", line 146, in download_chromium
extract_zip(download_zip(get_url()), DOWNLOADS_FOLDER / REVISION)
File "/home/shawley/anaconda3/envs/qe-mini-example/lib/python3.7/site-packages/pyppeteer/chromium_downloader.py", line 85, in download_zip
data = http.request('GET', url, preload_content=False)
File "/home/shawley/anaconda3/envs/qe-mini-example/lib/python3.7/site-packages/urllib3/request.py", line 76, in request
method, url, fields=fields, headers=headers, **urlopen_kw
File "/home/shawley/anaconda3/envs/qe-mini-example/lib/python3.7/site-packages/urllib3/request.py", line 97, in request_encode_url
return self.urlopen(method, url, **extra_kw)
File "/home/shawley/anaconda3/envs/qe-mini-example/lib/python3.7/site-packages/urllib3/poolmanager.py", line 336, in urlopen
response = conn.urlopen(method, u.request_uri, **kw)
File "/home/shawley/anaconda3/envs/qe-mini-example/lib/python3.7/site-packages/urllib3/connectionpool.py", line 765, in urlopen
**response_kw
File "/home/shawley/anaconda3/envs/qe-mini-example/lib/python3.7/site-packages/urllib3/connectionpool.py", line 765, in urlopen
**response_kw
File "/home/shawley/anaconda3/envs/qe-mini-example/lib/python3.7/site-packages/urllib3/connectionpool.py", line 765, in urlopen
**response_kw
File "/home/shawley/anaconda3/envs/qe-mini-example/lib/python3.7/site-packages/urllib3/connectionpool.py", line 725, in urlopen
method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
File "/home/shawley/anaconda3/envs/qe-mini-example/lib/python3.7/site-packages/urllib3/util/retry.py", line 439, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='storage.googleapis.com', port=443): Max retries exceeded with url: /chromium-browser-snapshots/Linux_x64/588429/chrome-linux.zip (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')])")))
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:17 (6 by maintainers)
Top Results From Across the Web
urllib and "SSL: CERTIFICATE_VERIFY_FAILED" Error
There is nothing wrong with the URL and it can be successfully verified with the common trusted certificates. So you should better not...
Read more >Certificates get corrupted after updating Acrobat or ...
Solution · For AATL: Under Categories, select Trust Manager and then select the Load trusted certificates from an Adobe AATL server check box...
Read more >SSL Certificate upload failing with error "Custom secure ...
This article describes an issue where installing an SSL certificate through the Prism SSL Certificate dialog fails with the error message ...
Read more >Troubleshooting Certificate Verification Failures
Verify the failure by accessing the same URL without Content Gateway and check the "Valid from ---- to ----" fields. The "Valid from"...
Read more >SSL error when loading files on demand (certificate verify ...
Download works for me, too. Just in case: Have you checked that you have the correct time on your localhost? That might prevent...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@dafriedman97 Maybe try this:
https://github.com/palmoreck/dockerfiles-for-binder/tree/jupyterlab_optimizacion#changes-for-palmoreckjupyterlab_optimizacion_binder_test_for_pdf214
I solved sth related to that one manually changing
pyppeteer/page.py
where is30000 #milliseconds
toself._defaultNavigationTimeout = 30000000000 # milliseconds
My book is very long in PDF form and this increasing the timeout did the trick. Anyone wanting to do this in an automated build could do the following before building the PDF