SSL_CERTIFICATE_VERIFY_FAILED in VS Code Python Debugger on macOS, Terminal and PyCharm Work Fine
@eleanorjboyd 已經在處理了。
開始於 2025年7月2日。
評估
這個 Issue 還沒有評估資料。
描述
Bug Description
When running Python unit tests that connect to AWS services inside the VS Code Python debugger, I consistently get:
yamlCopyEditssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate
-
This error occurs only inside the VS Code debugger
-
The same code works correctly:
-
In PyCharm's debugger
-
From the terminal using
pytest -
From VS Code's integrated terminal
-
-
Environment variables such as
SSL_CERT_FILEare set properly and visible inside the test -
ssl.get_default_verify_paths()reflects the correct certificate bundle -
The problem persists across Python 3.12 and 3.13
-
Downgrading the VS Code Python extension from
2025.8.0to2025.6.1does not resolve the issue
Reproduction Steps
-
On macOS 15.5 with Homebrew OpenSSL 3.5.0 installed
-
Create a Python virtual environment using python.org Python 3.12 or 3.13
-
Install
boto3,certifi, andpytest -
Set
SSL_CERT_FILEto point tocertifi'scacert.pembundle -
Run
pytestfrom terminal — works as expected -
Run debugger in VS Code (using the Python extension) — SSL error occurs
Environment Details
Component | Version -- | -- macOS | 15.5 (M4 MacBook Air) Python | 3.12 and 3.13 (installed from python.org) VS Code | [Insert your VS Code version, from About menu] VS Code Python Extension | Tested with 2025.8.0 and 2025.6.1 debugpy | VS Code bundled version (exact version unknown) Homebrew OpenSSL | 3.5.0What Works
✔ PyCharm debugger runs tests without SSL issues
✔ Running tests from terminal (pytest) works
✔ VS Code integrated terminal runs tests without issues
What Fails
❌ Running the same tests inside the VS Code Python debugger produces SSL_CERTIFICATE_VERIFY_FAILED
Additional Notes
-
This appears to be related to environment propagation or timing during debugger launch
-
The
debugpydebugger likely initializes Python'ssslcontext before theSSL_CERT_FILEenvironment variable is fully applied -
Recent updates to Homebrew OpenSSL 3.5.0 and/or macOS 15.5 may have exposed this behavior
-
Other developers using a similar setup may face this issue without realizing the debugger is the source
Request
Please investigate whether debugpy or the VS Code Python extension mishandles environment propagation during debugger launch, especially in relation to SSL_CERT_FILE and Python's ssl initialization.
✅ Thank you for your time and assistance.
- 主要語言
- TypeScript
- 星號
- 181
- 分支
- 126
- 平均合併
- 8 小時 49 分鐘
- 30 天內合併 PR
- 1
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
microsoft/vscode-python-debugger 的其他 Issue
-
triage-needed
難度 2/5 1-3 小時 新手友好度 78/100
microsoft/vscode-python-debugger#1110 ·
-
triage-needed
難度 1/5 1-3 小時 新手友好度 88/100
microsoft/vscode-python-debugger#1024 · 1 則留言 ·
-
triage-needed
microsoft/vscode-python-debugger#1111 · 1 個 reaction · 已指派 1 人 ·
-
triage-needed
microsoft/vscode-python-debugger#1104 · 1 個 reaction · 已指派 1 人 ·
-
triage-needed
難度 4/5 3-5 天 新手友好度 58/100
microsoft/vscode-python-debugger#1095 · 1 則留言 · 1 個 reaction ·
查看 microsoft/vscode-python-debugger 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 70/100
-
難度 2/5 1-3 小時 新手友好度 75/100
mksglu/context-mode#1200 ·
-
難度 2/5 1-3 小時 新手友好度 75/100
jaegertracing/jaeger-ui#4506 ·
-
area:desktop area:ui bug platform:macos
難度 2/5 1-3 小時 新手友好度 75/100
anthropics/claude-code#96687 ·
-
good first issue
難度 1/5 1 小時以內 新手友好度 95/100
AOSSIE-Org/DebateAI#582 · 2 則留言 ·