🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: muc.lists.freebsd.ports
Article #139

Re: The security/py-certifi port has not yet been updated (related to the leak of eMudhra's intermediate CA certificate)

#139
From: SASAKI Katuhiro
Date: Mon, 02 Nov 2026 02:38
229 lines
12905 bytes
This is a multi-part message in MIME format.

--Multipart=_Mon__2_Nov_2026_11_38_31_+0900_Xilyyizdu4=NdSr0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

(Since the mailing list address wasn't included in the 'cc:' field,
I've made the changes and resend.)
Hi.

On Mon, 26 Oct 2026 19:53:49 +0900
Tomoaki AOKI <junchoon@dec.sakura.ne.jp> wrote:

> On Mon, 26 Oct 2026 08:11:44 +0900
> SASAKI Katuhiro <crest@sahiro.org> wrote:
> 
> > It has been several days since the announcement of the leak of eMudhra's
> > intermediate CA certificate, but the security/py-certifi port has not been
> > updated. 
> > In the discourse on Pytho.org[1], it is stated that "It's important to
> > immediately upgrade the software packages below (includeing pip and certifi)
> > to at least the versions specified". 
> > Although an update request has been posted in Bugzilla, the update hasn't
> > been merged yet. Of course, the review and other procedures are probably
> > currently underway.
> > 
> > [1] https://discuss.python.org/t/information-for-python-users-regarding-emudhra-emsign-ca-certificate-security-incident/109576
> > 
> 
> Hi.
> 
> I found you've filed Bug300077 (not sure why it states devel/py-pip
> as the targetted port in the subject, though), but I found there's
> already Bug299779 filed earlier.
>   https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=299779
> 
> Isn't it sufficient? Or is there any reason that devel/py-pip
> require holding dedicated certificate that is exactly the same
> as security/py-certifi provides?
> 
I thought that pip would prioritize using the bundled certifi
package, but I hadn't actually verified that.
So, I actually ran the test script (attached). With the unpatched
pip says "TLS verification: SUCCESS" with the problematic site,
whereas patched pip says "TLS verification: FAILED". Note that the
py-certifi package has already been installed.
I just hope I haven't fundamentally misunderstood something...

> Of course, it's OK if you've found a reason that the certificate
> is needed inside ${WRKDIR} for sanely finish builds. But otherwise,
> depending on security/py-certifi normally is the good way not to
> be easily overlooked on upgrading devel/py-pip in the future.
> 
I pulled myself together and wrote a patch.
All it did was replace 'pip._vendor.certifi' to 'certifi', remove
the bundled 'certifi' package, and add a dependency on
'security/py-certifi'.
I haven't been able to run a proper test yet, but it looks like
the 'download' and 'install' commands are working.
However, since this would significantly change how pip works, I
don't think it would be accepted.

Kind regards,

-- 
                     SASAKI Katuhiro

                 mailto: crest@sahiro.org

--Multipart=_Mon__2_Nov_2026_11_38_31_+0900_Xilyyizdu4=NdSr0
Content-Type: text/x-python;
 name="check_pip_url.py"
Content-Disposition: attachment;
 filename="check_pip_url.py"
Content-Transfer-Encoding: 7bit

#!/usr/bin/env python3

import pip
from pip._internal.commands import create_command

URL = "https://dv-g3b-emudhra.we-have-a-problem.com/"

cmd = create_command("install")

options, args = cmd.parse_args([
    "--disable-pip-version-check"
])

session = cmd._build_session(options)

print("pip version:", pip.__version__)
print("verify:", session.verify)

try:
    response = session.get(URL, timeout=15)

    print("TLS verification: SUCCESS")
    print("HTTP status:", response.status_code)

except Exception as e:
    print("TLS verification: FAILED")
    print(type(e).__name__, e)

finally:
    session.close()

--Multipart=_Mon__2_Nov_2026_11_38_31_+0900_Xilyyizdu4=NdSr0
Content-Type: text/plain;
 name="py-pip.diff"
Content-Disposition: attachment;
 filename="py-pip.diff"
Content-Transfer-Encoding: 7bit

diff -urN ../py-pip.orig/Makefile ./Makefile
--- ../py-pip.orig/Makefile	2026-11-02 11:15:55.120561000 +0900
+++ ./Makefile	2026-11-02 10:47:33.229963000 +0900
@@ -1,6 +1,6 @@
 PORTNAME=	pip
 PORTVERSION=	23.3.2
-PORTREVISION=	4
+PORTREVISION=	5
 CATEGORIES=	devel python
 MASTER_SITES=	https://files.pythonhosted.org/packages/c3/9e/8a7ba2c9984a060daa6c6f9fff4d576b7ace3936239d6b771541eab972ed/:test_setuptools \
 		https://files.pythonhosted.org/packages/61/86/cc8d1ff2ca31a312a25a708c891cf9facbad4eae493b3872638db6785eb5/:test_wheel
@@ -29,6 +29,7 @@
 		${PYTHON_PKGNAMEPREFIX}virtualenv>=0:devel/py-virtualenv@${PY_FLAVOR} \
 		${PYTHON_PKGNAMEPREFIX}werkzeug>=0:www/py-werkzeug@${PY_FLAVOR} \
 		${PYTHON_PKGNAMEPREFIX}wheel>=0:devel/py-wheel@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}certifi>=0:security/py-certifi@${PY_FLAVOR} \
 		hg:devel/mercurial \
 		git:devel/git
 .if ${WITH_SUBVERSION_VER:U} == LTS
@@ -50,6 +51,8 @@
 
 SHEBANG_FILES=	src/pip/__init__.py
 
+RUN_DEPENDS=		${PYTHON_PKGNAMEPREFIX}certifi>=0:security/py-certifi@${PY_FLAVOR}
+
 # DOCS is broken with sphinx 9.0.4.
 # OPTIONS_DEFINE=	DOCS
 
@@ -66,6 +69,7 @@
 
 post-patch:
 	@${RM} -r ${WRKSRC}/src/pip/_vendor/colorama/tests/
+	@${RM} -r ${WRKSRC}/src/pip/_vendor/certifi/
 
 post-install-DOCS-on:
 	@${MKDIR} ${STAGEDIR}${DOCSDIR}
diff -urN ../py-pip.orig/files/patch-certifi ./files/patch-certifi
--- ../py-pip.orig/files/patch-certifi	1970-01-01 09:00:00.000000000 +0900
+++ ./files/patch-certifi	2026-10-31 00:09:35.034069000 +0900
@@ -0,0 +1,68 @@
+diff -urN ../pip-23.3.2.orig/setup.py ./setup.py
+--- ../pip-23.3.2.orig/setup.py	2023-12-17 21:35:15.000000000 +0900
++++ ./setup.py	2026-10-30 23:48:02.832915000 +0900
+@@ -62,7 +62,6 @@
+     package_data={
+         "pip": ["py.typed"],
+         "pip._vendor": ["vendor.txt"],
+-        "pip._vendor.certifi": ["*.pem"],
+         "pip._vendor.requests": ["*.pem"],
+         "pip._vendor.distlib._backport": ["sysconfig.cfg"],
+         "pip._vendor.distlib": [
+diff -urN ../pip-23.3.2.orig/src/pip/_internal/build_env.py ./src/pip/_internal/build_env.py
+--- ../pip-23.3.2.orig/src/pip/_internal/build_env.py	2023-12-17 21:35:15.000000000 +0900
++++ ./src/pip/_internal/build_env.py	2026-10-30 23:48:51.683650000 +0900
+@@ -11,7 +11,7 @@
+ from types import TracebackType
+ from typing import TYPE_CHECKING, Iterable, List, Optional, Set, Tuple, Type, Union
+ 
+-from pip._vendor.certifi import where
++from certifi import where
+ from pip._vendor.packaging.requirements import Requirement
+ from pip._vendor.packaging.version import Version
+ 
+diff -urN ../pip-23.3.2.orig/src/pip/_internal/commands/debug.py ./src/pip/_internal/commands/debug.py
+--- ../pip-23.3.2.orig/src/pip/_internal/commands/debug.py	2023-12-17 21:35:15.000000000 +0900
++++ ./src/pip/_internal/commands/debug.py	2026-10-30 23:49:26.622693000 +0900
+@@ -8,7 +8,7 @@
+ from typing import Any, Dict, List, Optional
+ 
+ import pip._vendor
+-from pip._vendor.certifi import where
++from certifi import where
+ from pip._vendor.packaging.version import parse as parse_version
+ 
+ from pip._internal.cli import cmdoptions
+@@ -193,7 +193,7 @@
+         show_value("'cert' config value", ca_bundle_info(self.parser.config))
+         show_value("REQUESTS_CA_BUNDLE", os.environ.get("REQUESTS_CA_BUNDLE"))
+         show_value("CURL_CA_BUNDLE", os.environ.get("CURL_CA_BUNDLE"))
+-        show_value("pip._vendor.certifi.where()", where())
++        show_value("certifi.where()", where())
+         show_value("pip._vendor.DEBUNDLED", pip._vendor.DEBUNDLED)
+ 
+         show_vendor_versions()
+diff -urN ../pip-23.3.2.orig/src/pip/_vendor/requests/certs.py ./src/pip/_vendor/requests/certs.py
+--- ../pip-23.3.2.orig/src/pip/_vendor/requests/certs.py	2023-12-17 21:35:15.000000000 +0900
++++ ./src/pip/_vendor/requests/certs.py	2026-10-30 23:49:57.374994000 +0900
+@@ -15,7 +15,7 @@
+ import os
+ 
+ if "_PIP_STANDALONE_CERT" not in os.environ:
+-    from pip._vendor.certifi import where
++    from certifi import where
+ else:
+     def where():
+         return os.environ["_PIP_STANDALONE_CERT"]
+diff -urN ../pip-23.3.2.orig/tests/functional/test_debug.py ./tests/functional/test_debug.py
+--- ../pip-23.3.2.orig/tests/functional/test_debug.py	2023-12-17 21:35:15.000000000 +0900
++++ ./tests/functional/test_debug.py	2026-10-30 23:48:28.190574000 +0900
+@@ -21,7 +21,7 @@
+         "'cert' config value: ",
+         "REQUESTS_CA_BUNDLE: ",
+         "CURL_CA_BUNDLE: ",
+-        "pip._vendor.certifi.where(): ",
++        "certifi.where(): ",
+         "pip._vendor.DEBUNDLED: ",
+         "vendored library versions:",
+     ],

--Multipart=_Mon__2_Nov_2026_11_38_31_+0900_Xilyyizdu4=NdSr0--


--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-admin@muc.de
Technical Details
Message-ID: <20261102113831.53ff1195c1e3fe97516a61cd@sahiro.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!3.eu.feeder.erje.net!feeder.erje.net!news2.arglkargh.de!news.karotte.org!news.space.net!news.muc.de!.POSTED.news.muc.de!not-for-mail
References: <20261026195349.1bf0a1dabacd270125d8dd7f@dec.sakura.ne.jp> <>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!3.eu.feeder.erje.net!feeder.erje.net!news2.arglkargh.de!news.karotte.org!news.space.net!news.muc.de!.POSTED.news.muc.de!not-for-mail
From: SASAKI Katuhiro <crest@sahiro.org>
Newsgroups: muc.lists.freebsd.ports
Subject: Re: The security/py-certifi port has not yet been updated (related
 to the leak of eMudhra's intermediate CA certificate)
Date: Mon, 2 Nov 2026 11:38:31 +0900
Organization: Newsgate at muc.de e.V.
Sender: owner-freebsd-ports@FreeBSD.org
Approved: news-admin@muc.de
Distribution: world
Message-ID: <20261102113831.53ff1195c1e3fe97516a61cd@sahiro.org>
References: <20261026195349.1bf0a1dabacd270125d8dd7f@dec.sakura.ne.jp> <>
MIME-Version: 1.0
Content-Type: multipart/mixed;
 boundary="Multipart=_Mon__2_Nov_2026_11_38_31_+0900_Xilyyizdu4=NdSr0"
Injection-Info: news.muc.de; posting-host="news.muc.de:193.149.48.2";
	logging-data="82648"; mail-complaints-to="news-admin@muc.de"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim;
	t=1793587147; h=from:from:sender:sender:reply-to:subject:subject:date:date:
	 message-id:message-id:to:to:cc:mime-version:mime-version:
	 content-type:content-type:in-reply-to:in-reply-to:
	 references:references:list-id:list-help:list-owner:list-unsubscribe:
	 list-subscribe:list-post; bh=zkw1TwY/VfRftoKybDsgt4Fal/UH55JCVqruNcAM4w4=;
	b=xVXuE0ofKpPwwNrGFAz5/Ang6hmKwa0toN1/+aw1iEmauP3ff0amED21P1NoVZb7bIpZB9
	+WgMWqqwOgtWcVJXdisenphlmXnmpKcvIXCdYcbJHsthdXtSPxWpBn1eE8LFtpiu9FIxV9
	10aMkuSf6u7A935NJtmNY+xzQqNwt4C8zMx6CbufwUtJkqjqzo74PdsH6RjBTL1ynB3x+l
	+VvRcIxSf3SFNjSfu78tyrxR/GoQweC06ioA29qOHisDPNGqSny8zyxnWGBwIcrnVr3LLq
	PwtKmpW+D0z4eTvOSshGeDBjJUZljBFLldgTdRnHeggupcTZSf0fAk3JYeJS0g==
X-Original-To: freebsd-ports@mlmmj.nyi.freebsd.org
Authentication-Results: mx1.freebsd.org;
	dkim=pass header.d=sahiro.org header.s=rs20240206 header.b=KsRIHU6s;
	spf=pass (mx1.freebsd.org: domain of crest@sahiro.org designates 133.167.8.150 as permitted sender) smtp.mailfrom=crest@sahiro.org;
	dmarc=pass (policy=none) header.from=sahiro.org
DKIM-Signature: a=rsa-sha256; bh=zkw1TwY/VfRftoKybDsgt4Fal/UH55JCVqruNcAM4w4=;
        c=relaxed/relaxed; d=sahiro.org;
        h=From:Message-Id:To:Subject:Date;
        s=rs20240206; t=1793587111; v=1;
        b=KsRIHU6s+f3SE2eQLoNLoEU5XuO+MQjrKBoOzzCC91ZF5CVUljblQnoD8/VcPyV1
         +uOM1W05dJ9lrKcu3nEbT84AAPAb4zA8xRuGSO+el32FZ4YLnMEZY7GlGYBeazkN
         /ADFWn/gzYxskZeqwuy1o4fm+SOb8xqhZm43qP29kuby1nLHzsUuM46ITMdk+HyU
         MGVZPyEOUXWmoJONj7/nmlY53j+Ks3+/VD7FVFiMLfoq9UvHXfEXPn0TVebZxqc0
         Nm5bob+Xs2FzRZziAmmBX+FGuXupH5zqbpHPMRc3L098Q6tUu2cx7g73TAvYtFCZ
         me1nQwfYUVUUbOy2MDyjtw==
In-Reply-To: <20261026195349.1bf0a1dabacd270125d8dd7f@dec.sakura.ne.jp>
X-BeenThere: freebsd-ports@freebsd.org
Precedence: list
X-Anti-Virus-Server: fsav314.rs.sakura.ne.jp
X-Rspamd-Queue-Id: 4jHwr23ll0z4P7l
X-Spamd-Bar: ++
X-Spamd-Result: default: False [2.10 / 15.00];
	SUSPICIOUS_URL_IN_SUSPICIOUS_MESSAGE(1.00)[];
	MV_CASE(0.50)[];
	URIBL_RED(0.50)[dec.sakura.ne.jp:email];
	HAS_ANON_DOMAIN(0.10)[];
	BAD_REP_POLICIES(0.10)[];
	MIME_GOOD(-0.10)[multipart/mixed,text/plain,text/x-python];
	DKIM_TRACE(0.00)[sahiro.org:+];
	R_SPF_ALLOW(0.00)[+a:sahiro.sakura.ne.jp];
	RCPT_COUNT_ONE(0.00)[1];
	ASN(0.00)[asn:9371, ipnet:133.167.0.0/16, country:JP];
	RCVD_VIA_SMTP_AUTH(0.00)[];
	ARC_NA(0.00)[];
	MIME_TRACE(0.00)[0:+,1:+,2:+,3:+];
	DMARC_POLICY_ALLOW(0.00)[sahiro.org,none];
	MLMMJ_DEST(0.00)[freebsd-ports@FreeBSD.org];
	R_DKIM_ALLOW(0.00)[sahiro.org:s=rs20240206];
	RCVD_COUNT_TWO(0.00)[2];
	FROM_EQ_ENVFROM(0.00)[];
	FROM_HAS_DN(0.00)[];
	MID_RHS_MATCH_FROM(0.00)[];
	TO_DN_NONE(0.00)[];
	PREVIOUSLY_DELIVERED(0.00)[freebsd-ports@freebsd.org];
	TO_MATCH_ENVRCPT_ALL(0.00)[];
	RCVD_TLS_LAST(0.00)[];
	HAS_ATTACHMENT(0.00)[]
X-Newsgate-Id: f02c70b8849f+
X-No-Archive: Yes