#7242 [deepseek] 无法连接到 https://api.deepseek.com/v1/,可能当前网络不可访问该API, 若是本地服务,请确认已部署并启动Connection error.:Traceback (most recent c

2409**84d6 Posted at: 1 hour ago

[deepseek] 无法连接到 https://api.deepseek.com/v1/,可能当前网络不可访问该API, 若是本地服务,请确认已部署并启动
Connection error.:Traceback (most recent call last):
File "httpx\_transports\default.py", line 101, in map_httpcore_exceptions
File "httpx\_transports\default.py", line 250, in handle_request
File "httpcore\_sync\connection_pool.py", line 216, in handle_request
File "httpcore\_sync\connection_pool.py", line 196, in handle_request
File "httpcore\_sync\connection.py", line 99, in handle_request
File "httpcore\_sync\connection.py", line 76, in handle_request
File "httpcore\_sync\connection.py", line 154, in _connect
File "httpcore\_backends\sync.py", line 152, in start_tls
File "contextlib.py", line 153, in exit
File "httpcore\_exceptions.py", line 14, in map_exceptions
httpcore.ConnectError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1017)

The above exception was the direct cause of the following except
......
ttpx\_client.py", line 1014, in _send_single_request
File "httpx\_transports\default.py", line 249, in handle_request
File "contextlib.py", line 153, in exit
File "httpx\_transports\default.py", line 118, in map_httpcore_exceptions
httpx.ConnectError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1017)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "videotrans\translator\_openaicompat.py", line 88, in _item_task
File "videotrans\translator\_openaicompat.py", line 48, in _create_completion
File "openai\_utils\_utils.py", line 298, in wrapper
File "openai\resources\chat\completions\completions.py", line 1215, in create
File "openai\_base_client.py", line 1332, in post
File "openai\_base_client.py", line 1072, in request
openai.APIConnectionError: Connection error.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "videotrans\util\TestSrtTrans.py", line 19, in run
File "videotrans\translator\_runner.py", line 67, in run
File "videotrans\translator\_base.py", line 70, in run
File "videotrans\translator\_base.py", line 153, in _run_srt
File "tenacity\__init__.py", line 338, in wrapped_f
File "tenacity\__init__.py", line 477, in call
File "tenacity\__init__.py", line 378, in iter
File "tenacity\__init__.py", line 400, in
File "concurrent\futures\_base.py", line 451, in result
File "concurrent\futures\_base.py", line 403, in __get_result
File "tenacity\__init__.py", line 480, in call
File "videotrans\translator\_openaicompat.py", line 90, in _item_task
videotrans.configure.excepts.StopTask: [deepseek] 无法连接到 https://api.deepseek.com/v1/,可能当前网络不可访问该API, 若是本地服务,请确认已部署并启动
Connection error.


=
system:Windows-10-10.0.26200-SP0
version:v4.12
frozen:True
language:zh_CN
root_dir:D:/Translate AI

1 Replies

#1 DeepSeek reply at 1 hour ago

`
原因:SSL 证书验证失败(CERTIFICATE_VERIFY_FAILED: self signed certificate in certificate chain),说明你的网络环境存在一个自签名证书的中间人代理(常见于:公司内网 HTTPS 拦截、抓包工具如 Fiddler/Charles/Clash TUN 模式、杀毒软件的 SSL 扫描功能)。DeepSeek 官方 API 使用的是合法 CA 证书,被替换后就无法通过校验。

解决方案(按优先级尝试):

  1. 检查并关闭代理/抓包工具

    • 如果你开启了 Clash、v2ray、Fiddler、Charles 等代理软件,请先完全退出(不仅仅是关闭系统代理,要确认进程结束)。
    • 主界面“对齐控制”行右侧有网络代理文本框,如果是国内 DeepSeek API,请不要填写任何代理,清空后保存。
    • 注意:DeepSeek 是国内 API,软件内置免代理列表,正常无需走代理。如果你的代理软件设置了“全局模式”或“TUN 模式”,会强制接管流量并替换证书,就会导致此错。
  2. 关闭杀毒软件的 HTTPS/SSL 扫描

    • 360、火绒、卡巴斯基等在开启“网页防护/SSL扫描”时会插入自签名证书。请暂时关闭该功能或将 pyVideoTrans 目录加入信任白名单。
  3. 检查系统时间

    • SSL 证书校验依赖系统时间,若系统时间不准确会导致校验失败。请先同步系统时间。
  4. 验证网络连通性

    • 打开浏览器访问 https://api.deepseek.com ,若浏览器也提示证书警告,说明问题出在网络环境(代理/防火墙),而非软件本身。
  5. 确认 API Key 已正确配置

    • 进入 菜单 -> 翻译设置 -> DeepSeek,确认密钥已填写且余额充足(若 Key 错误通常报 401,不是证书错误,但可一并检查)。

若以上排查后仍报错,请把 logs/ 目录下当天日志文件的底部约 30 行内容贴出,以便进一步分析。

请查阅相关文档:

Thinking...
Post Your Reply
If you have more than 50 messages, you will no longer receive an automatic reply. Please ask a new question!
Open source and free maintenance is not easy. If this project is helpful to you, please consider making a small donation to help the project continue to maintain and update.

Dondate via ko-fi.com

Related resource