Skip to content

fix(cli): default SSL cert file to certifi#20

Merged
Sodawyx merged 1 commit into
mainfrom
fix-default-certifi-ca
Jul 6, 2026
Merged

fix(cli): default SSL cert file to certifi#20
Sodawyx merged 1 commit into
mainfrom
fix-default-certifi-ca

Conversation

@117503445

Copy link
Copy Markdown
Collaborator

Summary

  • default SSL_CERT_FILE to certifi.where() when the user has not set it
  • declare certifi as a direct runtime dependency
  • add unit coverage for the default and explicit-override behavior

Root Cause

The v0.1.2 standalone binary can fail FC TempBucket HTTPS requests with CERTIFICATE_VERIFY_FAILED unless SSL_CERT_FILE is manually set. The CLI should have a stable CA bundle by default while still allowing users to override it with the standard SSL_CERT_FILE environment variable.

Validation

  • .venv/bin/ruff check src/ tests/
  • .venv/bin/ruff format --check src/ tests/
  • .venv/bin/mypy src/agentrun_cli
  • .venv/bin/pytest tests/unit/test_main.py tests/integration/test_main.py
  • .venv/bin/pytest tests/unit tests/integration (590 passed)
  • make build
  • frozen binary real smoke with SSL_CERT_FILE / REQUESTS_CA_BUNDLE unset: skill create returned CREATING, first poll returned READY, then the test skill was deleted

Supersedes #19 with a simpler business-code implementation.

Copilot AI review requested due to automatic review settings July 6, 2026 07:34

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to make the CLI’s HTTPS certificate verification more reliable (especially in the frozen binary) by defaulting SSL_CERT_FILE to the CA bundle shipped with certifi, while still allowing users to override via SSL_CERT_FILE.

Changes:

  • Default SSL_CERT_FILE to certifi.where() in the CLI entrypoint when the user hasn’t set it.
  • Add certifi as a direct runtime dependency.
  • Add unit tests covering defaulting behavior and preserving a user-provided SSL_CERT_FILE.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/agentrun_cli/main.py Sets a default CA bundle path via SSL_CERT_FILE during module import.
tests/unit/test_main.py Adds unit tests validating default and override behavior for SSL_CERT_FILE.
pyproject.toml Declares certifi as a runtime dependency to support the new defaulting behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/agentrun_cli/main.py Outdated
Comment thread tests/unit/test_main.py Outdated
Comment on lines +28 to +32
monkeypatch.setattr(main_module.certifi, "where", lambda: "/tmp/cacert.pem")

importlib.reload(main_module)

assert main_module.os.environ["SSL_CERT_FILE"] == "/custom/ca.pem"
Signed-off-by: 117503445 <t117503445@gmail.com>
@117503445 117503445 force-pushed the fix-default-certifi-ca branch from 56fb50b to aa54213 Compare July 6, 2026 08:00
@Sodawyx Sodawyx merged commit 93d5c04 into main Jul 6, 2026
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants