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
3 changes: 3 additions & 0 deletions aliyun-python-sdk-core/ChangeLog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
2026-08-17 Version 2.16.1
1, Update vendored certifi from 2018.01.18 to 2026.07.22 to fix CVE-2023-37920 (remove e-Tugra roots).

2024-10-09 Version 2.16.0
1, Dropped support for Python 3.6.

Expand Down
2 changes: 1 addition & 1 deletion aliyun-python-sdk-core/aliyunsdkcore/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "2.16.0"
__version__ = "2.16.1"


import logging
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from .core import where, old_where

__version__ = "2018.01.18"
__version__ = "2026.07.22"
4,810 changes: 2,168 additions & 2,642 deletions aliyun-python-sdk-core/aliyunsdkcore/vendored/requests/packages/certifi/cacert.pem

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
~~~~~~~~~~

This module returns the installation location of cacert.pem.

Vendored from certifi 2026.07.22. The where() implementation keeps using
__file__ so the CA bundle resolves correctly under the nested
aliyunsdkcore.vendored.requests.packages.certifi package path
(importlib.resources with package name "certifi" would not work here).
"""
import os
import warnings
Expand All @@ -32,6 +37,3 @@ def old_where():
DeprecatedBundleWarning
)
return where()

if __name__ == '__main__':
print(where())
58 changes: 58 additions & 0 deletions aliyun-python-sdk-core/tests/test_certifi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Copyright 2026 Alibaba Cloud Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import os
import re
import unittest
import warnings

from aliyunsdkcore.vendored.requests.packages import certifi
from aliyunsdkcore.vendored.requests.packages.certifi import core as certifi_core
from aliyunsdkcore.vendored.requests import certs


class CertifiTest(unittest.TestCase):

def test_version_fixes_cve_2023_37920(self):
# CVE-2023-37920 is fixed in certifi >= 2023.07.22
match = re.match(r'^(\d{4})\.(\d{2})\.(\d{2})$', certifi.__version__)
self.assertIsNotNone(match, 'unexpected certifi version: %s' % certifi.__version__)
year, month, day = (int(g) for g in match.groups())
self.assertGreaterEqual((year, month, day), (2023, 7, 22))

def test_cacert_pem_exists_via_where(self):
path = certifi.where()
self.assertTrue(os.path.isfile(path))
self.assertEqual(os.path.basename(path), 'cacert.pem')
self.assertGreater(os.path.getsize(path), 0)

def test_requests_certs_uses_vendored_certifi(self):
self.assertEqual(certs.where(), certifi.where())

def test_cacert_pem_excludes_e_tugra_roots(self):
with open(certifi.where(), 'r') as f:
content = f.read()
self.assertNotIn('E-Tugra', content)
self.assertNotIn('e-Tugra', content)

def test_old_where_aliases_where(self):
with warnings.catch_warnings(record=True) as caught:
warnings.simplefilter('always')
path = certifi_core.old_where()
self.assertEqual(path, certifi.where())
self.assertTrue(any(issubclass(w.category, certifi_core.DeprecatedBundleWarning)
for w in caught))


if __name__ == '__main__':
unittest.main()
Loading