Bug 9439

Summary: Verify that the REST API works with https
Product: [Yocto Project Subprojects] Layer Index Reporter: Belen Barros Pena <belen.barros.pena>
Component: Layer Index MetadataAssignee: Elliot Smith <elliot.smith>
Status: RESOLVED OBSOLETE QA Contact: Libertad <libertad.gonzalez.de.la.cruz>
Severity: enhancement    
Priority: Medium+ CC: bluelightning, brian.avery, mhalstead
Version: unspecified   
Target Milestone: 2.2 M2   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Belen Barros Pena 2016-04-12 11:31:48 UTC
It was brought to our attention that the Layer Index does not have support for https. I believe Michael Halstead is pretty much ready to roll that out, but before he does we need to make sure Toaster can still retrieve information via the REST API when we switch to https by default.
Comment 1 Elliot Smith 2016-04-19 11:24:05 UTC
Paul and Belen have tested this with Toaster.

I've done a quick verification that urllib2 can access https sites (urllib2 is what we're using in LayerIndexLayerSource.update(), which fetches the layer index JSON).

However, we have some code in LayerIndexLayerSource which looks up the http_proxy env variable and makes use of this. If Toaster is using https to access the layer index in an env with proxies, we will need to get the https_proxy instead, so we may need some code changes here.
Comment 2 Elliot Smith 2016-04-19 11:36:07 UTC
It looks like urllib2 automatically figures out the proxy settings; the code just looks them up for the purposes of printing debug output, so the code changes are minor.
Comment 3 Elliot Smith 2016-04-19 12:22:11 UTC
Submitted a patch to show https_proxy in error output:
https://lists.yoctoproject.org/pipermail/toaster/2016-April/004469.html

The code needs no additional changes, as urllib2 automatically uses any http_proxy and https_proxy settings in the environment.
Comment 4 Elliot Smith 2016-07-04 15:38:25 UTC
Submitted v2 patch:
https://lists.yoctoproject.org/pipermail/toaster/2016-June/004904.html
Comment 5 Elliot Smith 2016-07-05 15:46:27 UTC
Michael is making changing in this area of the code, including better capturing of errors, so marking this OBSOLETE.