Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions py3-certifi.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package:
name: py3-certifi
version: "2025.04.26"
version: "2025.06.15"
epoch: 0
description: Python3 package for providing Mozilla's CA Bundle
copyright:
Expand Down Expand Up @@ -46,7 +46,7 @@ pipeline:
with:
repository: https://github.com/certifi/python-certifi.git
tag: ${{package.version}}
expected-commit: 275c9eb55733a464589c15fb4566fddd4598e5b2
expected-commit: e767d5938eddddf804216cec93a55c85129c5f2d

- uses: patch
with:
Expand Down
42 changes: 15 additions & 27 deletions py3-certifi/use-alpine-system-certs.patch
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ this package as a dependency for other packages without worries.
This is based on the patch used by Debian

diff --git a/certifi/core.py b/certifi/core.py
index de02898..9c0235f 100644
index 1c9661c..32423f7 100644
--- a/certifi/core.py
+++ b/certifi/core.py
@@ -6,13 +6,13 @@ This module returns the installation location of cacert.pem or its contents.
"""
import sys
@@ -10,13 +10,13 @@ import atexit
def exit_cacert_ctx() -> None:
_CACERT_CTX.__exit__(None, None, None) # type: ignore[union-attr]

+ALPINE_CA_CERTS_PATH = '/etc/ssl/certs/ca-certificates.crt'

Expand All @@ -29,7 +29,15 @@ index de02898..9c0235f 100644

def where() -> str:
# This is slightly terrible, but we want to delay extracting the file
@@ -45,8 +45,7 @@ elif sys.version_info >= (3, 7):
@@ -44,14 +44,14 @@ if sys.version_info >= (3, 11):
return _CACERT_PATH

def contents() -> str:
- return files("certifi").joinpath("cacert.pem").read_text(encoding="ascii")
+ with open(where(), "r", encoding="ascii") as data:
+ return data.read()

else:

from importlib.resources import path as get_path, read_text

Expand All @@ -39,30 +47,10 @@ index de02898..9c0235f 100644

def where() -> str:
# This is slightly terrible, but we want to delay extracting the
@@ -71,10 +70,11 @@ elif sys.version_info >= (3, 7):
_CACERT_CTX = get_path("certifi", "cacert.pem")
_CACERT_PATH = str(_CACERT_CTX.__enter__())

- return _CACERT_PATH
+ return ALPINE_CA_CERTS_PATH
@@ -80,4 +80,5 @@ else:
return _CACERT_PATH

def contents() -> str:
- return read_text("certifi", "cacert.pem", encoding="ascii")
+ with open(where(), "r", encoding="ascii") as data:
+ return data.read()

else:
import os
@@ -100,9 +100,7 @@ else:
# If we don't have importlib.resources, then we will just do the old logic
# of assuming we're on the filesystem and munge the path directly.
def where() -> str:
- f = os.path.dirname(__file__)
-
- return os.path.join(f, "cacert.pem")
-
+ return ALPINE_CA_CERTS_PATH
def contents() -> str:
- return read_text("certifi", "cacert.pem", encoding="ascii")
+ with open(where(), "r", encoding="ascii") as data:
+ return data.read()
Loading