58.1. python3-certifi-2026.7.22
The CA bundle python libraries look for by name
| Version | 2026.7.22, release 1 |
| Shelf | python-net — python3-* HTTP, web-framework, TLS-trust and network-stack modules |
| Phase | 30_foundation (Build Foundation), 56 of 127 in build order |
| Licence | MPL-2.0 |
| Homepage | https://pypi.org/project/certifi/ |
| Build time | 0.1 SBU |
| Installed size | 15.7 KiB in 20 files |
| Recipe | ports/core/python-net/python3-certifi/kpkgbuild |
About
certifi is a Python package whose only content is a CA bundle and two functions: certifi.where() returns the bundle’s path and certifi.contents() its text. python3-requests takes its trust anchors from there rather than asking the system.
KDOS ships no copy of certifi’s bundle. After the install, build.sh replaces certifi/cacert.pem with a symbolic link to /etc/ssl/cert.pem, the file ca-certificates writes, so Python code trusts exactly the roots OpenSSL does, local roots included; see TLS trust anchors.
Sources
python3-certifi-2026.7.22.tar.gz(134.9 KiB)
sha256741e2c3b351ddf169a738da9f2c048608ff7f2c5cc02f1ebc6b118bb090d5d55
upstream: https://files.pythonhosted.org/packages/source/c/certifi/certifi-2026.7.22.tar.gz
archive copy: sources-4/python-net--python3-certifi-2026.7.22.tar.gz
Dependencies
Depends on: python3, python3-setuptools, python3-pip, ca-certificates.
Required by (8): cura, jupyterlab, python3-meshtastic, python3-requests, python3-sphinx, skyfield, vdirsyncer, yt-dlp.
Installation
From the repository root, inside the build container, this is the line kdosbuild runs for the port:
script/chroot/exec.sh bash -c 'source script/phases/30_foundation/phase.env && kpkg install python3-certifi'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/python-net/python3-certifi.
1. Verify every declared source. Each file a sha256 = line names, found in the port directory or in /var/cache/kpkg/sources, must hash to its line; a mismatch stops the build before anything is unpacked.
cd /ports/core/python-net/python3-certifi
echo '741e2c3b351ddf169a738da9f2c048608ff7f2c5cc02f1ebc6b118bb090d5d55 python3-certifi-2026.7.22.tar.gz' | sha256sum -c -
2. Unpack. The work directory is emptied and the first source is unpacked into $SRC with its top directory stripped; any later tarball lands unstripped beside it in $SRC_ROOT, and a file that is not a tarball is copied into $SRC.
SRC_ROOT=/var/cache/kpkg/work/python3-certifi
SRC=$SRC_ROOT/python3-certifi-2026.7.22
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf python3-certifi-2026.7.22.tar.gz -C "$SRC" --strip-components=1
Every config.guess and config.sub older than automake’s is then replaced with automake’s, so a configure script recognises the musl target.
3. Build. build.sh is sourced in a subshell under set -e, from $SRC, with name, version, release and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:
pip3 install --ignore-installed --no-deps --no-index --no-build-isolation --root=$PKG --prefix=/usr .
pem=$(echo "$PKG"/usr/lib/python3*/site-packages/certifi/cacert.pem)
test -f "$pem"
ln -sf /etc/ssl/cert.pem "$pem"
The switches, and why each is set:
--no-build-isolation— Build with the setuptools already installed in the build root (requires = ["setuptools >= 42.0.0"]) rather than one pip would fetch into a temporary environment; python3-setuptools is independs.
The common switches of each build system are explained in the Flag glossary.
4. Package. kpkg removes libtool archives, the info directory index, mimeinfo.cache and every fonts.dir from $PKG, copies the source’s licence files into /usr/share/licenses/python3-certifi, prunes what the image does not ship, lints the tree and rolls it reproducibly:
tar --sort=name --format=gnu --numeric-owner --owner=0 --group=0 \
--mtime=@$SOURCE_DATE_EPOCH \
--use-compress-program='xz -9 -T0 --block-size=32MiB --no-adjust' \
-cf python3-certifi-2026.7.22-1.tar.xz -C "$PKG" .
5. Adopt. kpkgadd installs the package’s files over the root, refusing a path another package owns, records the file list in /var/lib/kpkg/db/python3-certifi, and runs the triggers its paths call for.
Contents
Installed directories: /usr/lib/python3.14/site-packages/certifi, /usr/lib/python3.14/site-packages/certifi-2026.7.22.dist-info, /usr/share/licenses/python3-certifi.
Notes
pem=$(echo …/python3*/site-packages/certifi/cacert.pem) expands to the installed file only when the glob matches exactly one path. With no match it stays the literal pattern, and with two interpreter directories it becomes two paths in one word, and in both cases test -f "$pem" fails the build instead of leaving the bundled copy in place.
The link points at a file no package owns: /etc/ssl/cert.pem is generated by update-ca-certificates, which ca-certificates runs when it is installed and upgraded. Until then the link dangles; ca-certificates is in depends. A local root added to /etc/ca-certificates/trust-source/anchors/ reaches Python only after update-ca-certificates has run again.