canonical / canonical/testflinger
Allow HTTPS based provisioning verification on Muxpi
- Dominant language
- Python
- Stars
- 26
- Forks
- 49
- Avg merge
- 4d 8h
- Merged PRs (30d)
- 16
Description
Hi. The muxpi connector currently supports requesting a URL during provisioning to determine if the device is alive. Would it be possible to allow this to work with HTTPS ?
The current connector code appears to be:
```python
try:
with urllib.request.urlopen(
boot_check_url, timeout=5
) as response:
if response.status == 200:
return True
logger.info(
"Check returned %d, expecting 200", response.status
)
except urllib.error.URLError as e:
logger.info("Boot check failed with %s", e)
```
It looks like supplying an SSL context should fix it. Specifically, I do not want the device TLS certificate or hostname to be verified, to support different TLS schemes which may not rely on externally signed certificates.
```python
import urllib2
import ssl
ctx = ssl.create_default_context()
ctx.check_hostname = False
ctx.verify_mode = ssl.CERT_NONE
urllib2.urlopen("https://your-test-server.local", context=ctx)
```
Does this sound like a doable request ? I assume that supplying an SSL context does not prevent HTTP.
Contributor guide
Research direction
Start at the Muxpi connector's provisioning boot-check code shown in the issue and inspect how urllib.request.urlopen currently handles boot_check_url. Verify that HTTP continues to work while HTTPS permits unverified device certificates and hostnames. Done means a successful HTTPS response with status 200 is accepted without certificate or hostname verification.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- devops
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100