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

打包为可执行文件后仍遭遇ssl.SSLCertVerificationError问题求助

问题:打包为可执行文件后ssl.SSLCertVerificationError复现,部分功能仍触发错误

我之前用python-certifi-win32包解决了ssl.SSLCertVerificationError问题,但将项目打包成可执行文件后,该错误再次出现。参考其他帖子加入如下修复代码后,项目另一部分仍触发相同错误:

已尝试的修复代码

if sys.platform == 'win32':
    import certifi_win32
    os.environ['REQUESTS_CA_BUNDLE'] = certifi_win32.wincerts.where()
    certifi_win32.generate_pem()

当前报错信息(中文翻译版)

Tkinter回调异常
回溯(最近的调用最后):
  文件 "tkinter\__init__.py",第1948行,在__call__中
  文件 "customtkinter\windows\widgets\ctk_button.py",第554行,在_clicked中
    self._command()
  文件 "src\app\frontend\main_ui.py",第51行,在run_orm_google_sheets中
    status = orm.run_google_sheets_save(drive_folder_id)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  文件 "src\app\backend\oscilloscope_report_maker.py",第219行,在run_google_sheets_save中
    spreadsheet_id = gs.create("Report")
                     ^^^^^^^^^^^^^^^^^^^
  文件 "src\app\backend\google_sheets_api_methods.py",第41行,在create中
    .execute()
     ^^^^^^^^^
  文件 "googleapiclient\_helpers.py",第130行,在positional_wrapper中
  文件 "googleapiclient\http.py",第923行,在execute中
  文件 "googleapiclient\http.py",第222行,在_retry_request中
  文件 "googleapiclient\http.py",第191行,在_retry_request中
  文件 "google_auth_httplib2.py",第218行,在request中
  文件 "httplib2\__init__.py",第1724行,在request中
  文件 "httplib2\__init__.py",第1444行,在_request中
  文件 "httplib2\__init__.py",第1366行,在_conn_request中
  文件 "httplib2\__init__.py",第1158行,在connect中
  文件 "ssl.py",第517行,在wrap_socket中
  文件 "ssl.py",第1075行,在_create中
  文件 "ssl.py",第1346行,在do_handshake中
ssl.SSLCertVerificationError: [SSL: 证书验证失败] 证书验证失败:证书链中存在自签名证书 (_ssl.c:1002)

内容的提问来源于stack exchange,提问作者Ahill Savio

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.07 21:47:33