Skip to content

feat(rumqttc): add use-rustls-no-provider feature#988

Merged
giridher-art merged 1 commit intobytebeamio:mainfrom
Matt3o12:main
Sep 14, 2025
Merged

feat(rumqttc): add use-rustls-no-provider feature#988
giridher-art merged 1 commit intobytebeamio:mainfrom
Matt3o12:main

Conversation

@Matt3o12
Copy link
Contributor

@Matt3o12 Matt3o12 commented Sep 3, 2025

Add new feature 'use-rustls-no-provider' which uses rustls but does not enable the default features so that the consumer can choose which crypto backend to use (ring, or rustls-openssl, etc) without being
forced to compile aws_lc_rs.

Because it is a new feature, this should be backwards compatible. Ideally, this crate should not have used default = true at all but just removing it could break some clients that expect rumqttc to run
without explicitly specifying the dependency. Worse, adding 'default-features = False' would allow the clients to compile but panic during runtime with

Could not automatically determine the process-level CryptoProvider from Rustls crate features.
Call CryptoProvider::install_default() before this point to select a provider manually, or make sure exactly one of the 'aws-lc-rs' and 'ring' features is enabled.
See the documentation of the CryptoProvider type for more information.

This feature is inspired by reqwest which has a similar feature: 'rustls-tls-webpki-roots-no-provider'.

Additionally, it might make sense to add the feature 'rustls-tls-min' in the future which does not pull in 'rustls-tls-webpki' and requires the developer to provide their own trust store with a custom
config to make the binary smaller.

Type of change

  • New feature (non-breaking change which adds functionality)

Checklist:

  • Formatted with cargo fmt
  • Make an entry to CHANGELOG.md if it's relevant to the users of the library. If it's not relevant mention why.

Copy link
Collaborator

@giridher-art giridher-art left a comment

Choose a reason for hiding this comment

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

@Matt3o12 LGTM , Update the CHANGELOG

@Matt3o12
Copy link
Contributor Author

Hey thanks for the review.

I have already updated the changelog.md and I have also rebased my commit to the tip of main again, maybe this fixes the pipeline failures?

@giridher-art
Copy link
Collaborator

@Matt3o12 can you include the changes in unreleased section?

Add new feature 'use-rustls-no-provider' which uses rustls but does not
enable the default features so that the consumer can choose which crypto
backend to use (ring, or rustls-openssl, etc) without being forced to
compile aws_lc_rs.

Because it is a new feature, this should be backwards compatible.
Ideally, this crate should not have used default = true at all but just
removing it could break some clients that expect rumqttc to run without
explicitly specifying the dependency. Worse, adding 'default-features =
False' would allow the clients to compile but panic during runtime with

```
Could not automatically determine the process-level CryptoProvider from Rustls crate features.
Call CryptoProvider::install_default() before this point to select a provider manually, or make sure exactly one of the 'aws-lc-rs' and 'ring' features is enabled.
See the documentation of the CryptoProvider type for more information.
```

This feature is inspired by reqwest which has a similar feature:
'rustls-tls-webpki-roots-no-provider'.

Additionally, it might make sense to add the feature
'rustls-tls-min' in the future which does not pull in
'rustls-tls-webpki' and requires the developer to provide their own
trust store with a custom config to make the binary smaller.
@Matt3o12
Copy link
Contributor Author

Sorry my bad, must have occurred while merging the changes. It should be under unreleased now.

@giridher-art giridher-art merged commit 0dc418d into bytebeamio:main Sep 14, 2025
1 of 4 checks passed
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