Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

toolchain.py build kivy fails with CERTIFICATE_VERIFY_FAILED #282

Closed
scolcombe opened this issue Apr 15, 2018 · 6 comments
Closed

toolchain.py build kivy fails with CERTIFICATE_VERIFY_FAILED #282

scolcombe opened this issue Apr 15, 2018 · 6 comments

Comments

@scolcombe
Copy link

Hi-
macos 10.11.6
python 2.7.14 [intel]
kivy-ios latest
kivy 1.10.0
urllib3 1.22
pyopenssl 17.5.0

I am trying to build kivy-ios from the git repository on my system (toolchain.py build kivy). All goes well until the point where it tries to download libffi-3.2.1.tar.gz, where I get the CERTIFICATE_VERIFY_FAILED error. See below.

I've downloaded the tarfile via wget into .cache and tried compiling libffi explicitly (from: https://www.bountysource.com/issues/35347723-failed-build-openssl). But the toolchain script still tries (and fails) to download the source tarball.

Hopefully, this is something straightforward with a simple workaround that I'm overlooking. Not really all that familiar with either the build process or urlllib on python.

The full log is here (toolchain.log.txt), but I also pasted just the crashy parts below:
[....]
Download libffi
Downloading https://www.mirrorservice.org/sites/sourceware.org/pub/libffi/libffi-3.2.1.tar.gz
Traceback (most recent call last):
File "toolchain.py", line 1364, in
ToolchainCL()
File "toolchain.py", line 1113, in init
getattr(self, args.command)()
File "toolchain.py", line 1154, in build
build_recipes(args.recipe, ctx)
File "toolchain.py", line 1004, in build_recipes
recipe.execute()
File "/Users/stan/git/kivy-ios/toolchain.py", line 612, in execute
self.download()
File "/Users/stan/git/kivy-ios/toolchain.py", line 55, in _cache_execution
f(self, *args, **kwargs)
File "/Users/stan/git/kivy-ios/toolchain.py", line 641, in download
self.download_file(self.url.format(version=self.version), fn)
File "/Users/stan/git/kivy-ios/toolchain.py", line 433, in download_file
urlretrieve(url, filename, report_hook)
File "/Users/stan/anaconda/envs/kivy/lib/python2.7/urllib.py", line 245, in retrieve
fp = self.open(url, data)
File "/Users/stan/anaconda/envs/kivy/lib/python2.7/urllib.py", line 213, in open
return getattr(self, name)(url)
File "/Users/stan/anaconda/envs/kivy/lib/python2.7/urllib.py", line 443, in open_https
h.endheaders(data)
File "/Users/stan/anaconda/envs/kivy/lib/python2.7/httplib.py", line 1038, in endheaders
self._send_output(message_body)
File "/Users/stan/anaconda/envs/kivy/lib/python2.7/httplib.py", line 882, in _send_output
self.send(msg)
File "/Users/stan/anaconda/envs/kivy/lib/python2.7/httplib.py", line 844, in send
self.connect()
File "/Users/stan/anaconda/envs/kivy/lib/python2.7/httplib.py", line 1263, in connect
server_hostname=server_hostname)
File "/Users/stan/anaconda/envs/kivy/lib/python2.7/ssl.py", line 363, in wrap_socket
_context=self)
File "/Users/stan/anaconda/envs/kivy/lib/python2.7/ssl.py", line 611, in init
self.do_handshake()
File "/Users/stan/anaconda/envs/kivy/lib/python2.7/ssl.py", line 840, in do_handshake
self._sslobj.do_handshake()
IOError: [Errno socket error] [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:661)

@danmacnaughtan
Copy link

You could try installing libffi using brew before building.

@scolcombe
Copy link
Author

scolcombe commented Apr 21, 2018 via email

@adibub
Copy link

adibub commented Apr 25, 2018

I just posted the same issue, sorry for this. But my solution was to change the first line in toolchain.py to usr/bin/python. Check which python you are using!

@danmacnaughtan
Copy link

A possible, insecure, workaround is to export PYTHONHTTPSVERIFY=0 before running the build script.

@akshayaurora
Copy link
Member

akshayaurora commented Jul 11, 2018

This is a generic issue with python where it needs to use latest openssl not the older one. Fixing your PATH should help with this. In other word make sure openssl version run on command line loads up libressl.

If using brew update openssl.

Closing as this is not a Kivy-ios specific issue.

@jmosk
Copy link

jmosk commented Aug 24, 2022

I know this is not a Kivy related issue BUT this problem happens during the command Toolkit Buiild Kivy when installing Kivy. Had me going for days until solved. I loaded the latest OpenSSL and ensured the build was using it - same problem. I puked down the certificate from the URL that was failing and out it in the keychain. It was not shown as trusted so I overload it to make it trust always. It still failed, I finally found that in the python folder there is a program to update certificates. Running that did resolve the problem and the build ran fine.
https://www.dev2qa.com/how-to-fix-python-error-certificate-verify-failed-unable-to-get-local-issuer-certificate-in-mac-os/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants