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 'use-rustls' and 'native-tls' features #13

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

SirBubbls
Copy link

This PR introduces two new cargo features:

  • (default) native-tls which enables the reqwest default-tls feature -> this configuration is the same as the previous default. Therefore no change in default behvior is introduced.
  • use-rustls replaces the default-tls feature with the rustls-tls-manual-roots reqwest feature. This removes the openssl dependency and uses the rustls ssl implemention.

This change is useful, because for some use cases it may not be optimal to depend on the openssl system lib. For example cross-compilation.

Caveats

The hawkbit lib lists the hawkbit_mock lib as a dev dependency. This is proplematic, because it depends on the httpmock lib, which has no option to turn off native-tls.
Even though it is only a test dependency, running cargo build will still fail if openssl is not available on the system. -> Open issue and workaround (requires nightly) here rust-lang/cargo#5133.

openssl-sys v0.9.83
├── curl v0.4.44
│   └── isahc v1.7.2
│       └── httpmock v0.5.8
│           └── hawkbit_mock v0.6.0 (/hawkbit-rs/hawkbit_mock)
│               [dev-dependencies]
│               └── hawkbit v0.6.0 (/hawkbit-rs/hawkbit)
│                   └── hawkbit_mock v0.6.0 (/hawkbit-rs/hawkbit_mock) (*)

This commit introduces two new features:
- (default) `native-tls` which enables the reqwest `default-tls`
feature -> this configuration is the same as the previous
default. Therefore no change in default behvior is introduced.
- `use-rustls` replaces the `default-tls` feature with the
`rustls-tls-manual-roots` reqwest feature. This removes the openssl
dependency and uses the rustls ssl implemention.

This change is useful, because for some use cases it may not be
optimal to depend on the openssl system lib. For example cross-compilation.
this instructs reqwest to use system cas for cert validation
Copy link

@stappersg stappersg left a comment

Choose a reason for hiding this comment

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

LGTM

Choose a reason for hiding this comment

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

Looks good to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants