Skip to content
This repository was archived by the owner on Apr 21, 2026. It is now read-only.

Fix: detect and surface SSL certificate errors in tracking hook - #5

Open
valenvivaldi wants to merge 1 commit into
fyso-dev:mainfrom
valenvivaldi:fix/ssl-cert-validation
Open

Fix: detect and surface SSL certificate errors in tracking hook#5
valenvivaldi wants to merge 1 commit into
fyso-dev:mainfrom
valenvivaldi:fix/ssl-cert-validation

Conversation

@valenvivaldi

Copy link
Copy Markdown
Contributor

Problem

On macOS with a fresh Python install, the SSL certificate store is not configured. This causes all tracking hook calls to silently fail with CERTIFICATE_VERIFY_FAILED — no error visible to the user, tracking just stops working.

Solution

  • Detect SSL errors specifically in the except block of tracking.sh
  • Write ~/.fyso/ssl-error.log with platform-specific fix instructions (macOS + generic pip)
  • Warn early on subsequent hook runs: if ssl-error.log exists, print a visible stderr message and exit before doing any work
  • Users clear the flag (rm ~/.fyso/ssl-error.log) after fixing to re-enable tracking

Behavior after this fix

First SSL failure writes:

~/.fyso/ssl-error.log
  [2026-03-31T...Z] SSL error: ...
  Fix on macOS:
    open /Applications/Python 3.*/Install Certificates.command
  Fix on any OS:
    pip install --upgrade certifi
  After fixing, delete this file to re-enable tracking:
    rm ~/.fyso/ssl-error.log

Subsequent hook runs print to stderr:

[fyso] SSL certificate error detected. Tracking is disabled.
[fyso] Fix: open /Applications/Python 3.*/Install Certificates.command
[fyso] Then delete ~/.fyso/ssl-error.log to re-enable tracking.

When Python's SSL cert store is not configured (common on macOS after
fresh Python install), tracking silently fails. This change:
- Detects CERTIFICATE_VERIFY_FAILED errors specifically
- Writes ~/.fyso/ssl-error.log with fix instructions (macOS + generic)
- On subsequent runs, exits early with a visible stderr warning
- Users clear the flag file after fixing to re-enable tracking
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant