Skip to content

test(util): cover create_no_verify_ssl_context security invariants#287

Draft
bluetoothbot wants to merge 2 commits into
openvideolibs:asyncfrom
bluetoothbot:koan/test-no-verify-ssl-context
Draft

test(util): cover create_no_verify_ssl_context security invariants#287
bluetoothbot wants to merge 2 commits into
openvideolibs:asyncfrom
bluetoothbot:koan/test-no-verify-ssl-context

Conversation

@bluetoothbot

@bluetoothbot bluetoothbot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

What: Add a unit test locking down the security invariants of create_no_verify_ssl_context().

Why: This helper builds the SSL context used for every HTTPS call to a camera. It intentionally disables cert and hostname verification (cameras ship self-signed certs) and enables OP_LEGACY_SERVER_CONNECT for old firmware. It was the only untested public function in onvif/util.py — a regression that accidentally re-enabled verification or dropped legacy connect would silently break connectivity to real devices with no test to catch it.

How: Asserts observable behavior of the returned context — check_hostname is False, verify_mode is CERT_NONE, and the legacy-connect option bit is set. No production code changed.

Testing: .venv/bin/python -m pytest tests/test_util.py -q → 26 passed.


Quality Report

Changes: 87 files changed, 9573 insertions(+), 1474 deletions(-)

Code scan: 20 issue(s) found

  • README.rst:61 — debug print statement
  • README.rst:111 — debug print statement
  • examples/events.py:20 — debug print statement
  • examples/events.py:24 — debug print statement
  • examples/events.py:25 — debug print statement
  • examples/events.py:27 — debug print statement
  • examples/events.py:29 — debug print statement
  • examples/events.py:62 — debug print statement
  • examples/events.py:74 — debug print statement
  • examples/events.py:84 — debug print statement

Tests: failed (FAILED)

Branch hygiene: clean

Generated by Kōan

@codecov

codecov Bot commented Jul 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

1 participant