Skip to content

fix: detect missing cryptography/SECP384R1 before deployment starts#14970

Merged
dguido merged 1 commit intomainfrom
fix/early-secp384r1-detection
Feb 22, 2026
Merged

fix: detect missing cryptography/SECP384R1 before deployment starts#14970
dguido merged 1 commit intomainfrom
fix/early-secp384r1-detection

Conversation

@dguido
Copy link
Copy Markdown
Member

@dguido dguido commented Feb 22, 2026

Summary

  • Add pre-flight SECP384R1 check in main.yml that catches missing/broken cryptography before deployment starts, replacing the cryptic community.crypto error with an actionable fix message
  • Add cryptography>=42.0.0 as explicit dependency in pyproject.toml
  • Upgrade community.crypto to >=3.1.1 to fix ec.__dict__.get() vs getattr() bug exposed by cryptography 46.0.5
  • Add ansible-galaxy collection install step to CI (was missing, causing CI to use the older bundled collection)
  • Use venv Python interpreter for local deployments in add_host tasks

Root cause analysis

The IPsec CI failures were caused by cryptography 46.0.5 (released 2026-02-11) which wraps the ec module with _ModuleWithDeprecations for SECT curve deprecation. This wrapper intercepts __getattr__ but doesn't populate __dict__, breaking community.crypto's ec.__dict__.get("SECP384R1") lookup. The fix in community.crypto 3.1.1 (PR #981) switches to getattr().

Test plan

  • CI integration tests pass (wireguard, ipsec, both)
  • ansible-lint . passes
  • yamllint . passes
  • pytest tests/unit/ -q passes
  • Pre-flight check fires with actionable message when cryptography is missing

🤖 Generated with Claude Code

@dguido dguido requested a review from jackivanov as a code owner February 22, 2026 09:57
…ility

Add pre-flight check in main.yml that catches missing cryptography/SECP384R1
before deployment starts, replacing the cryptic error from community.crypto
internals with an actionable message pointing users to run ./algo or uv sync.

Root cause of the CI ipsec/both test failures: cryptography 46.0.5 wraps
the ec module with _ModuleWithDeprecations (for SECT curve deprecation),
which breaks community.crypto's ec.__dict__.get("SECP384R1") lookup.
The fix in community.crypto 3.1.1 uses getattr() instead.

Changes:
- Add SECP384R1 pre-flight check to main.yml (conditional on ipsec_enabled)
- Add cryptography>=42.0.0 as explicit dependency in pyproject.toml
- Upgrade community.crypto to >=3.1.1 (fixes __dict__ vs getattr bug)
- Add ansible-galaxy collection install step to CI
- Use venv Python interpreter for local deployments in add_host tasks

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@dguido dguido force-pushed the fix/early-secp384r1-detection branch from 67dc048 to d4d6550 Compare February 22, 2026 10:33
@dguido dguido merged commit de11b86 into main Feb 22, 2026
27 checks passed
@dguido dguido deleted the fix/early-secp384r1-detection branch February 22, 2026 10:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant