Skip to content

bug(backend): WebSocket connections fail with SSL CERTIFICATE_VERIFY_FAILED — self-signed cert not trusted #4664

@mrveiss

Description

@mrveiss

Bug

/var/log/autobot/backend-error.log logs continuously (every few seconds):

Unexpected WebSocket error: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate (_ssl.c:1010)

Root Cause

Backend is attempting WebSocket connections to a service using a self-signed TLS certificate. Python's SSL context rejects it because the cert is not in the trusted CA store. No backoff — the reconnect loop floods the log.

Impact

MEDIUM — Any feature relying on these WebSocket connections silently fails. Log noise makes other errors hard to spot.

Fix

  1. Add the self-signed cert to the system trust store (update-ca-certificates) — preferred for internal services
  2. Or pass ssl=ssl.create_default_context(cafile='/path/to/cert.pem') to the WebSocket connect call
  3. Add exponential backoff to the reconnect loop to prevent log flooding

Metadata

Metadata

Assignees

No one assigned

    Labels

    backendbugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions