All of lore.kernel.org
 help / color / mirror / Atom feed
* python3-native certificate failure
@ 2018-04-04 20:09 Tom Hochstein
  2018-04-05  0:29 ` Khem Raj
  2018-04-19 10:35 ` Burton, Ross
  0 siblings, 2 replies; 5+ messages in thread
From: Tom Hochstein @ 2018-04-04 20:09 UTC (permalink / raw)
  To: openembedded-core

[-- Attachment #1: Type: text/plain, Size: 5056 bytes --]

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.

Tom

r60874@tx30imx-01:~/rocko/build-xwayland$ bitbake imx-gpu-sdk -c devshell
root@tx30imx-01:~/rocko/build-xwayland/tmp/work/aarch64-mx8qm-poky-linux/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://sourceforge.net/projects/tclap/files/tclap-1.2.2.tar.gz", "~")
Traceback (most recent call last):
  File "/home/r60874/rocko/build-xwayland/tmp/work/aarch64-mx8qm-poky-linux/imx-gpu-sdk/5.0.2-r0/recipe-sysroot-native/usr/lib/python3.5/urllib/request.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/imx-gpu-sdk/5.0.2-r0/recipe-sysroot-native/usr/lib/python3.5/http/client.py", line 1107, in request
    self._send_request(method, url, body, headers)
  File "/home/r60874/rocko/build-xwayland/tmp/work/aarch64-mx8qm-poky-linux/imx-gpu-sdk/5.0.2-r0/recipe-sysroot-native/usr/lib/python3.5/http/client.py", line 1152, in _send_request
    self.endheaders(body)
  File "/home/r60874/rocko/build-xwayland/tmp/work/aarch64-mx8qm-poky-linux/imx-gpu-sdk/5.0.2-r0/recipe-sysroot-native/usr/lib/python3.5/http/client.py", line 1103, in endheaders
    self._send_output(message_body)
  File "/home/r60874/rocko/build-xwayland/tmp/work/aarch64-mx8qm-poky-linux/imx-gpu-sdk/5.0.2-r0/recipe-sysroot-native/usr/lib/python3.5/http/client.py", line 934, in _send_output
    self.send(msg)
  File "/home/r60874/rocko/build-xwayland/tmp/work/aarch64-mx8qm-poky-linux/imx-gpu-sdk/5.0.2-r0/recipe-sysroot-native/usr/lib/python3.5/http/client.py", line 877, in send
    self.connect()
  File "/home/r60874/rocko/build-xwayland/tmp/work/aarch64-mx8qm-poky-linux/imx-gpu-sdk/5.0.2-r0/recipe-sysroot-native/usr/lib/python3.5/http/client.py", line 1261, in connect
    server_hostname=server_hostname)
  File "/home/r60874/rocko/build-xwayland/tmp/work/aarch64-mx8qm-poky-linux/imx-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/imx-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/imx-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/imx-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/imx-gpu-sdk/5.0.2-r0/recipe-sysroot-native/usr/lib/python3.5/urllib/request.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/imx-gpu-sdk/5.0.2-r0/recipe-sysroot-native/usr/lib/python3.5/urllib/request.py", line 163, in urlopen
    return opener.open(url, data, timeout)
  File "/home/r60874/rocko/build-xwayland/tmp/work/aarch64-mx8qm-poky-linux/imx-gpu-sdk/5.0.2-r0/recipe-sysroot-native/usr/lib/python3.5/urllib/request.py", line 466, in open
    response = self._open(req, data)
  File "/home/r60874/rocko/build-xwayland/tmp/work/aarch64-mx8qm-poky-linux/imx-gpu-sdk/5.0.2-r0/recipe-sysroot-native/usr/lib/python3.5/urllib/request.py", line 484, in _open
    '_open', req)
  File "/home/r60874/rocko/build-xwayland/tmp/work/aarch64-mx8qm-poky-linux/imx-gpu-sdk/5.0.2-r0/recipe-sysroot-native/usr/lib/python3.5/urllib/request.py", line 444, in _call_chain
    result = func(*args)
  File "/home/r60874/rocko/build-xwayland/tmp/work/aarch64-mx8qm-poky-linux/imx-gpu-sdk/5.0.2-r0/recipe-sysroot-native/usr/lib/python3.5/urllib/request.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/imx-gpu-sdk/5.0.2-r0/recipe-sysroot-native/usr/lib/python3.5/urllib/request.py", line 1256, in do_open
    raise URLError(err)
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:720)>

[-- Attachment #2: Type: text/html, Size: 9391 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: python3-native certificate failure
  2018-04-04 20:09 python3-native certificate failure Tom Hochstein
@ 2018-04-05  0:29 ` Khem Raj
  2018-04-05 13:13   ` Tom Hochstein
  2018-04-19 10:35 ` Burton, Ross
  1 sibling, 1 reply; 5+ messages in thread
From: Khem Raj @ 2018-04-05  0:29 UTC (permalink / raw)
  To: Tom Hochstein, openembedded-core

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@tx30imx-01:~/rocko/build-xwayland$ bitbake imx-gpu-sdk -c devshell
> 
> root@tx30imx-01:~/rocko/build-xwayland/tmp/work/aarch64-mx8qm-poky-linux/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://sourceforge.net/projects/tclap/files/tclap-1.2.2.tar.gz",
> "~")
> 
> Traceback (most recent call last):
> 
>   File
> "/home/r60874/rocko/build-xwayland/tmp/work/aarch64-mx8qm-poky-linux/imx-gpu-sdk/5.0.2-r0/recipe-sysroot-native/usr/lib/python3.5/urllib/request.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/imx-gpu-sdk/5.0.2-r0/recipe-sysroot-native/usr/lib/python3.5/http/client.py",
> line 1107, in request
> 
>     self._send_request(method, url, body, headers)
> 
>   File
> "/home/r60874/rocko/build-xwayland/tmp/work/aarch64-mx8qm-poky-linux/imx-gpu-sdk/5.0.2-r0/recipe-sysroot-native/usr/lib/python3.5/http/client.py",
> line 1152, in _send_request
> 
>     self.endheaders(body)
> 
>   File
> "/home/r60874/rocko/build-xwayland/tmp/work/aarch64-mx8qm-poky-linux/imx-gpu-sdk/5.0.2-r0/recipe-sysroot-native/usr/lib/python3.5/http/client.py",
> line 1103, in endheaders
> 
>     self._send_output(message_body)
> 
>   File
> "/home/r60874/rocko/build-xwayland/tmp/work/aarch64-mx8qm-poky-linux/imx-gpu-sdk/5.0.2-r0/recipe-sysroot-native/usr/lib/python3.5/http/client.py",
> line 934, in _send_output
> 
>     self.send(msg)
> 
>   File
> "/home/r60874/rocko/build-xwayland/tmp/work/aarch64-mx8qm-poky-linux/imx-gpu-sdk/5.0.2-r0/recipe-sysroot-native/usr/lib/python3.5/http/client.py",
> line 877, in send
> 
>     self.connect()
> 
>   File
> "/home/r60874/rocko/build-xwayland/tmp/work/aarch64-mx8qm-poky-linux/imx-gpu-sdk/5.0.2-r0/recipe-sysroot-native/usr/lib/python3.5/http/client.py",
> line 1261, in connect
> 
>     server_hostname=server_hostname)
> 
>   File
> "/home/r60874/rocko/build-xwayland/tmp/work/aarch64-mx8qm-poky-linux/imx-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/imx-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/imx-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/imx-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/imx-gpu-sdk/5.0.2-r0/recipe-sysroot-native/usr/lib/python3.5/urllib/request.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/imx-gpu-sdk/5.0.2-r0/recipe-sysroot-native/usr/lib/python3.5/urllib/request.py",
> line 163, in urlopen
> 
>     return opener.open(url, data, timeout)
> 
>   File
> "/home/r60874/rocko/build-xwayland/tmp/work/aarch64-mx8qm-poky-linux/imx-gpu-sdk/5.0.2-r0/recipe-sysroot-native/usr/lib/python3.5/urllib/request.py",
> line 466, in open
> 
>     response = self._open(req, data)
> 
>   File
> "/home/r60874/rocko/build-xwayland/tmp/work/aarch64-mx8qm-poky-linux/imx-gpu-sdk/5.0.2-r0/recipe-sysroot-native/usr/lib/python3.5/urllib/request.py",
> line 484, in _open
> 
>     '_open', req)
> 
>   File
> "/home/r60874/rocko/build-xwayland/tmp/work/aarch64-mx8qm-poky-linux/imx-gpu-sdk/5.0.2-r0/recipe-sysroot-native/usr/lib/python3.5/urllib/request.py",
> line 444, in _call_chain
> 
>     result = func(*args)
> 
>   File
> "/home/r60874/rocko/build-xwayland/tmp/work/aarch64-mx8qm-poky-linux/imx-gpu-sdk/5.0.2-r0/recipe-sysroot-native/usr/lib/python3.5/urllib/request.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/imx-gpu-sdk/5.0.2-r0/recipe-sysroot-native/usr/lib/python3.5/urllib/request.py",
> line 1256, in do_open
> 
>     raise URLError(err)
> 
> urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED]
> certificate verify failed (_ssl.c:720)>
> 
> 



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: python3-native certificate failure
  2018-04-05  0:29 ` Khem Raj
@ 2018-04-05 13:13   ` Tom Hochstein
  0 siblings, 0 replies; 5+ messages in thread
From: Tom Hochstein @ 2018-04-05 13:13 UTC (permalink / raw)
  To: Khem Raj, openembedded-core

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@gmail.com] 
Sent: Wednesday, April 4, 2018 7:29 PM
To: Tom Hochstein <tom.hochstein@nxp.com>; openembedded-core@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@tx30imx-01:~/rocko/build-xwayland$ bitbake imx-gpu-sdk -c 
> devshell
> 
> root@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)>
> 
> 



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: python3-native certificate failure
  2018-04-04 20:09 python3-native certificate failure Tom Hochstein
  2018-04-05  0:29 ` Khem Raj
@ 2018-04-19 10:35 ` Burton, Ross
  2018-04-19 12:11   ` Tom Hochstein
  1 sibling, 1 reply; 5+ messages in thread
From: Burton, Ross @ 2018-04-19 10:35 UTC (permalink / raw)
  To: Tom Hochstein; +Cc: openembedded-core

Why don't you just use the host Python?

This is probably due to the certificate path not being correctly
remapped as it goes in/out of sstate, you'll have to tell the SSL code
explicitly where to find the certificates.

Ross

On 4 April 2018 at 21:09, Tom Hochstein <tom.hochstein@nxp.com> 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.
>
>
>
> Tom
>
>
>
> r60874@tx30imx-01:~/rocko/build-xwayland$ bitbake imx-gpu-sdk -c devshell
>
> root@tx30imx-01:~/rocko/build-xwayland/tmp/work/aarch64-mx8qm-poky-linux/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://sourceforge.net/projects/tclap/files/tclap-1.2.2.tar.gz",
>>>> "~")
>
> Traceback (most recent call last):
>
>   File
> "/home/r60874/rocko/build-xwayland/tmp/work/aarch64-mx8qm-poky-linux/imx-gpu-sdk/5.0.2-r0/recipe-sysroot-native/usr/lib/python3.5/urllib/request.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/imx-gpu-sdk/5.0.2-r0/recipe-sysroot-native/usr/lib/python3.5/http/client.py",
> line 1107, in request
>
>     self._send_request(method, url, body, headers)
>
>   File
> "/home/r60874/rocko/build-xwayland/tmp/work/aarch64-mx8qm-poky-linux/imx-gpu-sdk/5.0.2-r0/recipe-sysroot-native/usr/lib/python3.5/http/client.py",
> line 1152, in _send_request
>
>     self.endheaders(body)
>
>   File
> "/home/r60874/rocko/build-xwayland/tmp/work/aarch64-mx8qm-poky-linux/imx-gpu-sdk/5.0.2-r0/recipe-sysroot-native/usr/lib/python3.5/http/client.py",
> line 1103, in endheaders
>
>     self._send_output(message_body)
>
>   File
> "/home/r60874/rocko/build-xwayland/tmp/work/aarch64-mx8qm-poky-linux/imx-gpu-sdk/5.0.2-r0/recipe-sysroot-native/usr/lib/python3.5/http/client.py",
> line 934, in _send_output
>
>     self.send(msg)
>
>   File
> "/home/r60874/rocko/build-xwayland/tmp/work/aarch64-mx8qm-poky-linux/imx-gpu-sdk/5.0.2-r0/recipe-sysroot-native/usr/lib/python3.5/http/client.py",
> line 877, in send
>
>     self.connect()
>
>   File
> "/home/r60874/rocko/build-xwayland/tmp/work/aarch64-mx8qm-poky-linux/imx-gpu-sdk/5.0.2-r0/recipe-sysroot-native/usr/lib/python3.5/http/client.py",
> line 1261, in connect
>
>     server_hostname=server_hostname)
>
>   File
> "/home/r60874/rocko/build-xwayland/tmp/work/aarch64-mx8qm-poky-linux/imx-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/imx-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/imx-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/imx-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/imx-gpu-sdk/5.0.2-r0/recipe-sysroot-native/usr/lib/python3.5/urllib/request.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/imx-gpu-sdk/5.0.2-r0/recipe-sysroot-native/usr/lib/python3.5/urllib/request.py",
> line 163, in urlopen
>
>     return opener.open(url, data, timeout)
>
>   File
> "/home/r60874/rocko/build-xwayland/tmp/work/aarch64-mx8qm-poky-linux/imx-gpu-sdk/5.0.2-r0/recipe-sysroot-native/usr/lib/python3.5/urllib/request.py",
> line 466, in open
>
>     response = self._open(req, data)
>
>   File
> "/home/r60874/rocko/build-xwayland/tmp/work/aarch64-mx8qm-poky-linux/imx-gpu-sdk/5.0.2-r0/recipe-sysroot-native/usr/lib/python3.5/urllib/request.py",
> line 484, in _open
>
>     '_open', req)
>
>   File
> "/home/r60874/rocko/build-xwayland/tmp/work/aarch64-mx8qm-poky-linux/imx-gpu-sdk/5.0.2-r0/recipe-sysroot-native/usr/lib/python3.5/urllib/request.py",
> line 444, in _call_chain
>
>     result = func(*args)
>
>   File
> "/home/r60874/rocko/build-xwayland/tmp/work/aarch64-mx8qm-poky-linux/imx-gpu-sdk/5.0.2-r0/recipe-sysroot-native/usr/lib/python3.5/urllib/request.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/imx-gpu-sdk/5.0.2-r0/recipe-sysroot-native/usr/lib/python3.5/urllib/request.py",
> line 1256, in do_open
>
>     raise URLError(err)
>
> urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED]
> certificate verify failed (_ssl.c:720)>
>
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: python3-native certificate failure
  2018-04-19 10:35 ` Burton, Ross
@ 2018-04-19 12:11   ` Tom Hochstein
  0 siblings, 0 replies; 5+ messages in thread
From: Tom Hochstein @ 2018-04-19 12:11 UTC (permalink / raw)
  To: Burton, Ross; +Cc: openembedded-core

Thanks, Ross. That is indeed what we are doing now.

Tom

-----Original Message-----
From: Burton, Ross [mailto:ross.burton@intel.com] 
Sent: Thursday, April 19, 2018 5:36 AM
To: Tom Hochstein <tom.hochstein@nxp.com>
Cc: openembedded-core@lists.openembedded.org
Subject: Re: [OE-core] python3-native certificate failure

Why don't you just use the host Python?

This is probably due to the certificate path not being correctly remapped as it goes in/out of sstate, you'll have to tell the SSL code explicitly where to find the certificates.

Ross

On 4 April 2018 at 21:09, Tom Hochstein <tom.hochstein@nxp.com> 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.
>
>
>
> Tom
>
>
>
> r60874@tx30imx-01:~/rocko/build-xwayland$ bitbake imx-gpu-sdk -c 
> devshell
>
> root@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.out
>>>> look.com/?url=https%3A%2F%2Fsourceforge.net%2Fprojects%2Ftclap%2Ffi
>>>> les%2Ftclap-1.2.2.tar.gz&data=02%7C01%7Ctom.hochstein%40nxp.com%7C7
>>>> 096802f05364674162908d5a5e161a0%7C686ea1d3bc2b4c6fa92cd99c5c301635%
>>>> 7C0%7C0%7C636597309792188874&sdata=sM3F9XsfnAyJALQv3zOjm4fOiLiV6DuY
>>>> jCg%2FOoD9GHM%3D&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)>
>
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> https://emea01.safelinks.protection.outlook.com/?url=http%3A%2F%2Flist
> s.openembedded.org%2Fmailman%2Flistinfo%2Fopenembedded-core&data=02%7C01%7Ctom.hochstein%40nxp.com%7C7096802f05364674162908d5a5e161a0%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C636597309792188874&sdata=MS1z%2FNo4umupW2EBfoZCzuIwUjcgfyPR8T0yrZ0UmWk%3D&reserved=0
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-04-19 12:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-04 20:09 python3-native certificate failure Tom Hochstein
2018-04-05  0:29 ` Khem Raj
2018-04-05 13:13   ` Tom Hochstein
2018-04-19 10:35 ` Burton, Ross
2018-04-19 12:11   ` Tom Hochstein

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.