Skip to content

Conversation

@kyrregjerstad
Copy link
Contributor

@kyrregjerstad kyrregjerstad commented Mar 9, 2025

Summary

This PR adds SSL certificate verification options, addressing the certificate verification issues.

Changes

  • Created a new utility module streamrip/utils/ssl_utils.py with helper functions for SSL context creation
  • Added verify_ssl parameter to network clients and API functions
  • Made certifi an optional dependency for certificate verification
  • Added --no-ssl-verify CLI option for troubleshooting
  • Implemented user-friendly error messages when certificate verification fails

Testing

  • SSL context creation with and without verification
  • Integration with network clients
  • CLI option registration
  • Error handling

Related issues:

Resolves #784
Resolves #747
Resolves #548
Resolves #775


I don't have access to a windows machine, so someone testing it in a windows environment would be appreciated.

- 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
- 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
- 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
@nathom
Copy link
Owner

nathom commented Mar 9, 2025

Nice! I tested with TIDAL and seems to work. Can you make sure the checks pass?

@kyrregjerstad
Copy link
Contributor Author

sure thing! ran ruff format tests/test_ssl_verification.py now, I see that there are some other ruff warning as well around the project, but left those files untouched

@nathom nathom merged commit dc7ca02 into nathom:dev Mar 10, 2025
0 of 2 checks passed
EllipPro added a commit to EllipPro/streamrip that referenced this pull request Aug 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants