Add SSL Verification Options and Improved Certificate Handling (#817)

* Add SSL verification configuration option

- Add `verify_ssl` parameter to DownloadsConfig to control SSL certificate verification
- Update client methods to use the new SSL verification setting
- Add CLI option `--no-ssl-verify` to disable SSL verification
- Implement SSL verification support across various clients and network requests
- Add test suite to validate SSL verification configuration

* Enhance SSL certificate handling with certifi support

- Add new `ssl_utils.py` module for SSL certificate management
- Implement optional certifi package support for improved certificate verification
- Add utility functions for creating SSL contexts and handling connector kwargs
- Update various clients to use new SSL utility functions
- Add helpful error messaging for SSL certificate verification issues
- Include optional certifi dependency in pyproject.toml

* Enhance SSL verification tests and configuration support

- Add comprehensive test suite for SSL verification utilities
- Implement tests for SSL context creation and configuration
- Update test configuration to include verify_ssl option
- Add test coverage for SSL verification across different clients and methods
- Improve error handling and testing for SSL-related configurations

* run ruff format

* Fix ruff checks

---------

Co-authored-by: Nathan Thomas <nathanthomas707@gmail.com>
This commit is contained in:
Kyrre Gjerstad 2025-03-10 16:41:06 +01:00 committed by GitHub
parent fe169fe2e6
commit dc7ca02529
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 596 additions and 75 deletions

View file

@ -39,6 +39,7 @@ pytest-mock = "^3.11.1"
pytest-asyncio = "^0.21.1"
rich = "^13.6.0"
click-help-colors = "^0.9.2"
certifi = { version = "^2025.1.31", optional = true }
[tool.poetry.urls]
"Bug Reports" = "https://github.com/nathom/streamrip/issues"
@ -89,3 +90,6 @@ skip-magic-trailing-comma = false
# Like Black, automatically detect the appropriate line ending.
line-ending = "auto"
[tool.poetry.extras]
ssl = ["certifi"]