You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Windows10+Python3.11发送邮件触发ssl.SSLError[X509V3:INVALID_CERTIFICATE]错误

问题:Windows 10 + Python 3.11 邮件脚本触发SSL证书无效错误

Windows 10系统,Python 3.11版本,运行常规邮件发送脚本时遭遇错误:ssl.SSLError: [X509V3: INVALID_CERTIFICATE] invalid certificate (_ssl.c:4035)。

已确认以下信息:

  • 同一代码在其他电脑可正常运行
  • 已执行命令 python -m pip install --upgrade --force-reinstall certifi 重装certifi并多次重启电脑
  • 同一电脑上无SSL的邮件连接代码可正常运行
  • 网上相关文章多针对MAC OS的SSL证书问题

请问是否需要在MMC中排查问题?

报错回溯信息:

Traceback (most recent call last):
  File "D:\Python\Projects\webscraping_tours\send_email.py", line 10, in <module>
    context = ssl.create_default_context()
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Python 3.11.7\Lib\ssl.py", line 775, in create_default_context
    context.load_default_certs(purpose)
  File "D:\Python 3.11.7\Lib\ssl.py", line 596, in load_default_certs
    self._load_windows_store_certs(storename, purpose)
  File "D:\Python 3.11.7\Lib\ssl.py", line 588, in _load_windows_store_certs
    self.load_verify_locations(cadata=certs)
ssl.SSLError: [X509V3: INVALID_CERTIFICATE] invalid certificate (_ssl.c:4035)

内容的提问来源于stack exchange,提问作者Eoin McDonnell

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.30 23:55:17