heard icon indicating copy to clipboard operation
heard copied to clipboard

SSL_CERT_FILE not set for non-bundle entrypoints; HTTPS fails with CERTIFICATE_VERIFY_FAILED

Open arthursolwayne opened this issue 7 months ago • 1 comments

Repro

Fresh install on macOS 13+, no SSL_CERT_FILE in env, no ElevenLabs key configured (so Kokoro is the active backend).

$ /Applications/Heard.app/Contents/MacOS/python -m heard doctor
...
Synth
  · backend               Kokoro (no ElevenLabs key configured)
  ✗ synth                 URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED]
                            certificate verify failed: unable to get local issuer
                            certificate (_ssl.c:1032)>
Persona (Haiku)
  ✗ anthropic key         (HTTPS fails the same way before key auth even runs)

Same failure surfaces as the toast "Heard — couldn't generate audio. Run heard doctor for details."

Cause

packaging/app_entry.py sets SSL_CERT_FILE to certifi.where() before any HTTPS-using import — but that file only runs as the menu-bar bundle's main entry. Other entrypoints bypass it entirely:

  • python -m heard <cmd> — CLI (doctor, demo, say, …)
  • python -m heard.hook <agent> — per-event hook subprocess
  • python -m heard.daemon — LaunchAgent / dev runs (also seen in the wild as a stale process; can't repro deliberately)

The frozen Python in the .app has no system CA, so any HTTPS call from those entrypoints fails.

Fix

Mirror the certifi setup at the top of heard/__init__.py so any import path is safe. PR #2 opened.

Workaround for affected users

launchctl setenv SSL_CERT_FILE /Applications/Heard.app/Contents/Resources/lib/python3.13/certifi/cacert.pem
launchctl setenv REQUESTS_CA_BUNDLE /Applications/Heard.app/Contents/Resources/lib/python3.13/certifi/cacert.pem
killall Heard ; open /Applications/Heard.app

Env

  • macOS 26 (also reported on 13+)
  • Heard v0.4 (pyproject 0.4.2, the bundled __version__ says 0.1.0 — separate cosmetic issue)

arthursolwayne avatar Apr 30 '26 22:04 arthursolwayne

Fixed by #2 (commit d8ad8ee). Thanks @arthursolwayne — clean repro, clean patch, tests included. Will ship in v0.4.3.

sodiumsun avatar May 02 '26 06:05 sodiumsun