Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for rustls #26

Merged
merged 6 commits into from
Apr 27, 2024
Merged

add support for rustls #26

merged 6 commits into from
Apr 27, 2024

Conversation

hungl6844
Copy link
Contributor

because openssl is a pain to cross-compile for, I have added the ability for users to switch to another backend instead. since the only configuration required to do so is enabling the features in reqwest, all I had to do was add a feature in ytmapi-rs that tells reqwest to switch the backend.

@nick42d nick42d self-assigned this Apr 24, 2024
@nick42d
Copy link
Owner

nick42d commented Apr 24, 2024

Hi @hungl6844 , cheers for the PR! Looks like there is a GtiHub issue blocking CI, bear with me while that gets resolved.

@nick42d
Copy link
Owner

nick42d commented Apr 24, 2024

Does this approach still use reqwest default features by default? That's my preference for now.

Copy link
Owner

Choose a reason for hiding this comment

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

Please delete lockfile, not required for library (my mistake I need to add this to gitignore in future)

@@ -11,7 +11,7 @@ readme = "README.md"

[dependencies]
tokio = {version = "1.29.1", features = ["full"]}
reqwest = {version = "0.12.1", features = ["json"]}
reqwest = {version = "0.12.1", features = ["json"], default-features = false, optional = true}
Copy link
Owner

Choose a reason for hiding this comment

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

Please add reqwest's non-tls related default features (e.g http2) https://docs.rs/reqwest/latest/reqwest/index.html

@@ -11,7 +11,7 @@ readme = "README.md"

[dependencies]
tokio = {version = "1.29.1", features = ["full"]}
reqwest = {version = "0.12.1", features = ["json"]}
reqwest = {version = "0.12.1", features = ["json"], default-features = false, optional = true}
Copy link
Owner

Choose a reason for hiding this comment

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

Reqwest is required openssl or not, so should not be optional = true

@@ -22,3 +22,8 @@ chrono = "0.4.31"

[dev-dependencies]
pretty_assertions = "1"

[features]
Copy link
Owner

Choose a reason for hiding this comment

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

please add "default" feature that uses reqwest defaults (breaks youtui binary otherwise)

Copy link
Owner

@nick42d nick42d left a comment

Choose a reason for hiding this comment

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

Added some comments

@hungl6844
Copy link
Contributor Author

First of all, yes, by default, openssl is still used when building the binary, the feature “rusttls-tls” is required to switch away. Thanks for pointing out the issues, I didn’t even realize the binary wasn’t building (I was only using ytmapi-rs, so I never built youtui). I will implement your changes as soon as possible!

@nick42d
Copy link
Owner

nick42d commented Apr 26, 2024

Made some slight changes, if you're happy with that I'll get this merged!

@hungl6844
Copy link
Contributor Author

Go for it!

@nick42d nick42d merged commit 01c1984 into nick42d:main Apr 27, 2024
0 of 3 checks passed
@nick42d
Copy link
Owner

nick42d commented Apr 27, 2024

Go for it!

We're in - thanks for your contrib :)
In future I'll look to improve this slightly to work around case where multiple features are specified - issue #30 added for tracking.

@github-actions github-actions bot mentioned this pull request Jun 12, 2024
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.

2 participants