fix: explicitly configure SSL certificates for DingTalk channel HTTP client#5291
Merged
zhijianma merged 1 commit intoJun 18, 2026
Merged
Conversation
…client - Add ssl and certifi imports to channel.py - Create SSL context with certifi's CA bundle when creating aiohttp.ClientSession - Fixes SSL certificate verification issues in uv-installed environments - Resolves issue agentscope-ai#5237 where DingTalk channel fails in internal network
|
Hi @wangfei010313, this is your 13th Pull Request. 🙌 Join Developer CommunityThanks so much for your contribution! We'd love to invite you to join the official QwenPaw developer group! You can find the Discord and DingTalk group links under the "Developer Community" section on our docs page: We truly appreciate your enthusiasm—and look forward to your future contributions! 😊 We'll review your PR soon. |
zhijianma
approved these changes
Jun 18, 2026
This was referenced Jun 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
When QwenPaw is installed via
uv tool install, the DingTalk channel fails to communicate becauseaiohttp.ClientSession()is created without explicit SSL certificate configuration. Inuv-managed virtual environments on Windows, the default SSL certificate store may not be correctly resolved, causing HTTPS requests to DingTalk APIs to fail with SSL verification errors.This fix explicitly configures the SSL context using
certifi's CA bundle when creating theaiohttp.ClientSession, ensuring consistent SSL certificate resolution regardless of the installation method (uv vs. Windows installer).Related Issue: Fixes #5237
Security Considerations: No security impact. The change uses
certifi's Mozilla CA bundle (already a transitive dependency) for certificate verification — this is the standard, secure approach. No certificates are weakened or bypassed.Type of Change
Component(s) Affected
Checklist
pre-commit run --all-fileslocally and it passespytestor as relevant) and they passFor Channel Changes (DingTalk, Feishu, QQ, Console, etc.)
./scripts/check-channels.sh(or./scripts/check-channels.sh --changed) and it passestests/contract/channels/test_dingtalk_contract.py(REQUIRED)create_instance()with proper channel initializationtests/contract/channels/__init__.py)tests/unit/channels/test_dingtalk.pyfor complex internal logicTesting
uv tool install qwenpawon Windowsclient_idandclient_secretRoot Cause
In
DingTalkChannel.start(), the HTTP client was created as:Without explicit SSL configuration,
aiohttprelies on the system's default certificate store. Inuv-managed virtual environments, the Python SSL module may not correctly locate the system CA certificates on Windows, causing all HTTPS requests to DingTalk APIs (sessionWebhook, Open API, media upload) to fail.Fix
certifiprovides a curated Mozilla CA bundle and is already a transitive dependency (viahttpx/requests). This ensures SSL certificate resolution works consistently across all installation methods and platforms.Workaround (for users on affected versions)
Users can work around this issue by setting the
SSL_CERT_FILEenvironment variable: