SSL_CERTIFICATE_VERIFY_FAILED in VS Code Python Debugger on macOS, Terminal and PyCharm Work Fine
@eleanorjboyd arbeitet bereits daran.
Seit 02.7.2025.
Bewertung
Dieses Issue wurde noch nicht bewertet.
Beschreibung
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.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 181
- Forks
- 126
- Ø Merge
- 8 Std. 49 Min.
- Gemergte PRs (30 T.)
- 1
Beitragsleitfaden
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus microsoft/vscode-python-debugger
-
triage-needed
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
microsoft/vscode-python-debugger#1110 ·
-
triage-needed
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 88/100
microsoft/vscode-python-debugger#1024 · 1 Kommentar ·
-
triage-needed
microsoft/vscode-python-debugger#1111 · 1 Reaktion · 1 zugewiesene Person ·
-
triage-needed
microsoft/vscode-python-debugger#1104 · 1 Reaktion · 1 zugewiesene Person ·
-
triage-needed
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 58/100
microsoft/vscode-python-debugger#1095 · 1 Kommentar · 1 Reaktion ·
Alle Issues in microsoft/vscode-python-debugger
Ähnliche Issues
-
VerificationGate: ATTRIBUTION quote guard never matches a normal quotation (\b around the quote) Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
danielmiessler/LifeOS#2234 ·
-
T: Bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 85/100
-
Mend: dependency security vulnerability untriaged
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100