[OE-core] python3-native certificate failure

Tom Hochstein tom.hochstein at nxp.com
Thu Apr 5 13:13:21 UTC 2018


But I am not using an SDK, I'm doing a straight bitbake. Using the native Python3 urllib.request.urlopen (via inherit python3native) from do_compile I see the certificate error. My original email duplicated the issue manually using -c devshell.

Tom

-----Original Message-----
From: Khem Raj [mailto:raj.khem at gmail.com] 
Sent: Wednesday, April 4, 2018 7:29 PM
To: Tom Hochstein <tom.hochstein at nxp.com>; openembedded-core at lists.openembedded.org
Subject: Re: [OE-core] python3-native certificate failure

On 4/4/18 1:09 PM, Tom Hochstein wrote:
> I am trying to download a URL from a source package using 
> python3-native, but it is failing with a certificate failure. I added 
> DEPENDS on ca-certificates-native and python3-certifi-native, but it 
> doesn't seem to help. A colleague with a corresponding SDK took the
> aarch64 sysroot certificates and dropped them in x86_64 sysroot and 
> the problem was fixed.
> 
>  

you might try adding nativesdk-ca-certificates to TOOLCHAIN_HOST_TASK and regenerate SDK

> 
> Tom
> 
>  
> 
> r60874 at tx30imx-01:~/rocko/build-xwayland$ bitbake imx-gpu-sdk -c 
> devshell
> 
> root at tx30imx-01:~/rocko/build-xwayland/tmp/work/aarch64-mx8qm-poky-lin
> ux/imx-gpu-sdk/5.0.2-r0/git#
> python3
> 
> Python 3.5.3 (default, Mar  6 2018, 14:15:44)
> 
> [GCC 5.4.0 20160609] on linux
> 
> Type "help", "copyright", "credits" or "license" for more information.
> 
>>>> import urllib.request
> 
>>>>
> urllib.request.urlretrieve("https://emea01.safelinks.protection.outloo
> k.com/?url=https%3A%2F%2Fsourceforge.net%2Fprojects%2Ftclap%2Ffiles%2F
> tclap-1.2.2.tar.gz&data=02%7C01%7Ctom.hochstein%40nxp.com%7Ca40b2e05d7
> aa43d50fc108d59a8c3bf6%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C63
> 6584849450785202&sdata=2BmKu3tXThT6%2FsHG0CzQJNPvXQ3gq2GJpahu2t8PNCY%3
> D&reserved=0",
> "~")
> 
> Traceback (most recent call last):
> 
>   File
> "/home/r60874/rocko/build-xwayland/tmp/work/aarch64-mx8qm-poky-linux/i
> mx-gpu-sdk/5.0.2-r0/recipe-sysroot-native/usr/lib/python3.5/urllib/req
> uest.py",
> line 1254, in do_open
> 
>     h.request(req.get_method(), req.selector, req.data, headers)
> 
>   File
> "/home/r60874/rocko/build-xwayland/tmp/work/aarch64-mx8qm-poky-linux/i
> mx-gpu-sdk/5.0.2-r0/recipe-sysroot-native/usr/lib/python3.5/http/clien
> t.py",
> line 1107, in request
> 
>     self._send_request(method, url, body, headers)
> 
>   File
> "/home/r60874/rocko/build-xwayland/tmp/work/aarch64-mx8qm-poky-linux/i
> mx-gpu-sdk/5.0.2-r0/recipe-sysroot-native/usr/lib/python3.5/http/clien
> t.py",
> line 1152, in _send_request
> 
>     self.endheaders(body)
> 
>   File
> "/home/r60874/rocko/build-xwayland/tmp/work/aarch64-mx8qm-poky-linux/i
> mx-gpu-sdk/5.0.2-r0/recipe-sysroot-native/usr/lib/python3.5/http/clien
> t.py",
> line 1103, in endheaders
> 
>     self._send_output(message_body)
> 
>   File
> "/home/r60874/rocko/build-xwayland/tmp/work/aarch64-mx8qm-poky-linux/i
> mx-gpu-sdk/5.0.2-r0/recipe-sysroot-native/usr/lib/python3.5/http/clien
> t.py",
> line 934, in _send_output
> 
>     self.send(msg)
> 
>   File
> "/home/r60874/rocko/build-xwayland/tmp/work/aarch64-mx8qm-poky-linux/i
> mx-gpu-sdk/5.0.2-r0/recipe-sysroot-native/usr/lib/python3.5/http/clien
> t.py",
> line 877, in send
> 
>     self.connect()
> 
>   File
> "/home/r60874/rocko/build-xwayland/tmp/work/aarch64-mx8qm-poky-linux/i
> mx-gpu-sdk/5.0.2-r0/recipe-sysroot-native/usr/lib/python3.5/http/clien
> t.py",
> line 1261, in connect
> 
>     server_hostname=server_hostname)
> 
>   File
> "/home/r60874/rocko/build-xwayland/tmp/work/aarch64-mx8qm-poky-linux/i
> mx-gpu-sdk/5.0.2-r0/recipe-sysroot-native/usr/lib/python3.5/ssl.py",
> line 385, in wrap_socket
> 
>     _context=self)
> 
>   File
> "/home/r60874/rocko/build-xwayland/tmp/work/aarch64-mx8qm-poky-linux/i
> mx-gpu-sdk/5.0.2-r0/recipe-sysroot-native/usr/lib/python3.5/ssl.py",
> line 760, in __init__
> 
>     self.do_handshake()
> 
>   File
> "/home/r60874/rocko/build-xwayland/tmp/work/aarch64-mx8qm-poky-linux/i
> mx-gpu-sdk/5.0.2-r0/recipe-sysroot-native/usr/lib/python3.5/ssl.py",
> line 996, in do_handshake
> 
>     self._sslobj.do_handshake()
> 
>   File
> "/home/r60874/rocko/build-xwayland/tmp/work/aarch64-mx8qm-poky-linux/i
> mx-gpu-sdk/5.0.2-r0/recipe-sysroot-native/usr/lib/python3.5/ssl.py",
> line 641, in do_handshake
> 
>     self._sslobj.do_handshake()
> 
> ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify 
> failed
> (_ssl.c:720)
> 
>  
> 
> During handling of the above exception, another exception occurred:
> 
>  
> 
> Traceback (most recent call last):
> 
>   File "<stdin>", line 1, in <module>
> 
>   File
> "/home/r60874/rocko/build-xwayland/tmp/work/aarch64-mx8qm-poky-linux/i
> mx-gpu-sdk/5.0.2-r0/recipe-sysroot-native/usr/lib/python3.5/urllib/req
> uest.py",
> line 188, in urlretrieve
> 
>     with contextlib.closing(urlopen(url, data)) as fp:
> 
>   File
> "/home/r60874/rocko/build-xwayland/tmp/work/aarch64-mx8qm-poky-linux/i
> mx-gpu-sdk/5.0.2-r0/recipe-sysroot-native/usr/lib/python3.5/urllib/req
> uest.py",
> line 163, in urlopen
> 
>     return opener.open(url, data, timeout)
> 
>   File
> "/home/r60874/rocko/build-xwayland/tmp/work/aarch64-mx8qm-poky-linux/i
> mx-gpu-sdk/5.0.2-r0/recipe-sysroot-native/usr/lib/python3.5/urllib/req
> uest.py",
> line 466, in open
> 
>     response = self._open(req, data)
> 
>   File
> "/home/r60874/rocko/build-xwayland/tmp/work/aarch64-mx8qm-poky-linux/i
> mx-gpu-sdk/5.0.2-r0/recipe-sysroot-native/usr/lib/python3.5/urllib/req
> uest.py",
> line 484, in _open
> 
>     '_open', req)
> 
>   File
> "/home/r60874/rocko/build-xwayland/tmp/work/aarch64-mx8qm-poky-linux/i
> mx-gpu-sdk/5.0.2-r0/recipe-sysroot-native/usr/lib/python3.5/urllib/req
> uest.py",
> line 444, in _call_chain
> 
>     result = func(*args)
> 
>   File
> "/home/r60874/rocko/build-xwayland/tmp/work/aarch64-mx8qm-poky-linux/i
> mx-gpu-sdk/5.0.2-r0/recipe-sysroot-native/usr/lib/python3.5/urllib/req
> uest.py",
> line 1297, in https_open
> 
>     context=self._context, check_hostname=self._check_hostname)
> 
>   File
> "/home/r60874/rocko/build-xwayland/tmp/work/aarch64-mx8qm-poky-linux/i
> mx-gpu-sdk/5.0.2-r0/recipe-sysroot-native/usr/lib/python3.5/urllib/req
> uest.py",
> line 1256, in do_open
> 
>     raise URLError(err)
> 
> urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] 
> certificate verify failed (_ssl.c:720)>
> 
> 




More information about the Openembedded-core mailing list