← Back to issue list

Use hkps by default

View original Github issue

Metadata

Project
snapcraft
Number
#5716
Type
issue
State
open
Author
dilyn-corner
Labels
Status: Triaged Type: Documentation
Created
2025-08-20 21:15:36+00:00
Updated
2025-08-21 15:38:29+00:00
Closed

Current evaluation

No evaluation has been recorded for this issue yet.

Issue body

https://github.com/canonical/snapcraft/blob/df4ec6775a28d4a345c93d9f83a1193c0abc1c9d/snapcraft_legacy/internal/repo/apt_key_manager.py#L148-L149 I think there are some circumstances where networks may fail to fetch a key unless `hkps://` is specified instead of the (presumed, usually working) `https://`. There's at least one observed instance where specifying the keyserver as `hkps://keyserver.ubuntu.com` instead of just `keyserver.ubuntu.com` resulted in a successful key fetch instead of the error being hit previously (something about "unable to fetch GPG key"). While technically hkps is served over port 443 like https, it's possible that some networking setups may not like this. This is largely speculation on my part, but from what I've seen it appears to be good practice to specify hkps. This may also impact craft-archives here https://github.com/canonical/craft-archives/blob/92c37a25d8efa7136223222d30043bf3e8d3fd12/craft_archives/repo/apt_key_manager.py#L301 I'm uncertain if this is better off as a code-change or a documentation update. It's probably easier in the documentation to explain that if a GPG key fetch error happens, specifying `key-server: hkps://keyserver.ubuntu.com` or the like may resolve the issue - @medubelko this kind of hits on https://github.com/canonical/craft-archives/issues/190, although some things may be hard-coded...

Evaluation history

No evaluation history available.