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

rumqttc: Enable native tls TlsConnector support. #870

Merged
merged 24 commits into from
Jun 18, 2024

Conversation

xiaocq2001
Copy link
Contributor

@xiaocq2001 xiaocq2001 commented May 22, 2024

Type of change

Resolves #866.

New feature (non-breaking change which adds functionality)

  • Transport::tls_with_config now accepts native_tls::TlsConnectorBuilder instance as input, to customize options

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.

rumqttc/src/lib.rs Outdated Show resolved Hide resolved
@xiaocq2001 xiaocq2001 marked this pull request as ready for review May 22, 2024 08:17
@de-sh de-sh added the 1.0 PRs that won't be merged into main until 1.0.0 label May 22, 2024
@xiaocq2001
Copy link
Contributor Author

Considering that the Native could be used to simplify native configuration to use OS settings, and there may be compatible issue, I added new NativeBuild to accept builder as input.

Copy link
Member

@de-sh de-sh left a comment

Choose a reason for hiding this comment

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

Hopefully no one depends on TlsConfiguration being Debug, Transport ain't so LGTM

@de-sh de-sh removed the 1.0 PRs that won't be merged into main until 1.0.0 label May 30, 2024
@coveralls
Copy link

coveralls commented May 31, 2024

Pull Request Test Coverage Report for Build 9561251742

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 0 of 4 (0.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.008%) to 36.123%

Changes Missing Coverage Covered Lines Changed/Added Lines %
rumqttc/src/tls.rs 0 1 0.0%
rumqttc/src/lib.rs 0 3 0.0%
Totals Coverage Status
Change from base Build 9290350918: -0.008%
Covered Lines: 5970
Relevant Lines: 16527

💛 - Coveralls

@de-sh
Copy link
Member

de-sh commented May 31, 2024

Since we don't do much with the Builder under the hood, why not just ask the user to build it first?

@xiaocq2001
Copy link
Contributor Author

xiaocq2001 commented Jun 3, 2024

Since we don't do much with the Builder under the hood, why not just ask the user to build it first?

I just keep align with the implement for rustls where ClientConfig is passed to build connection.

I saw the updates, that's fine, just accepted.

@xiaocq2001
Copy link
Contributor Author

xiaocq2001 commented Jun 6, 2024

Added wss (WebSocket Secure) support.
tls-native works fine connecting to mosquitto public broker.

Facing issue when using rustls, it always fail with "failed to lookup address information: Name or service not known", I guess some specific certification should be used?

I found the issue wss_with_config must be used instead of tls_with_config. The example works fine now.

@xiaocq2001
Copy link
Contributor Author

It's approved and tests are green, is there any more thing I need to do to let it merged?

BTW, is there any timeline for next rumqttc release and crate update?

@swanandx
Copy link
Member

It's approved and tests are green, is there any more thing I need to do to let it merged?

hey, thanks for your patience and reminder :) actually we got caught up with other work and so this was missed.

BTW, is there any timeline for next rumqttc release and crate update?

due to same reason of not having much bandwidth, can't commit to any specific date rn, but should be quite soon.

Copy link
Member

@de-sh de-sh left a comment

Choose a reason for hiding this comment

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

Please move changes regarding wss from this PR to another

rumqttc/src/v5/eventloop.rs Outdated Show resolved Hide resolved
rumqttc/src/v5/eventloop.rs Outdated Show resolved Hide resolved
rumqttc/src/eventloop.rs Outdated Show resolved Hide resolved
rumqttc/src/eventloop.rs Outdated Show resolved Hide resolved
@de-sh de-sh changed the title Enable native tls TlsConnectBuilder support. rumqttc: Enable native tls TlsConnector support. Jun 17, 2024
Copy link
Member

@de-sh de-sh left a comment

Choose a reason for hiding this comment

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

Post mentioned changes please open a separate PR to address native-tls support for websockets

rumqttc/Cargo.toml Outdated Show resolved Hide resolved
rumqttc/Cargo.toml Outdated Show resolved Hide resolved
rumqttc/examples/wss.rs Outdated Show resolved Hide resolved
xiaocq2001 and others added 7 commits June 18, 2024 08:37
Co-authored-by: Devdutt Shenoi <devdutt@outlook.in>
Co-authored-by: Devdutt Shenoi <devdutt@outlook.in>
Co-authored-by: Devdutt Shenoi <devdutt@outlook.in>
Co-authored-by: Devdutt Shenoi <devdutt@outlook.in>
Co-authored-by: Devdutt Shenoi <devdutt@outlook.in>
Co-authored-by: Devdutt Shenoi <devdutt@outlook.in>
@xiaocq2001
Copy link
Contributor Author

xiaocq2001 commented Jun 18, 2024

Please move changes regarding wss from this PR to another

OK, wss example removed. I'll create another PR for websocket changes on main right after this one is merged.

@xiaocq2001 xiaocq2001 requested a review from de-sh June 18, 2024 01:22
rumqttc/CHANGELOG.md Outdated Show resolved Hide resolved
rumqttc/src/lib.rs Outdated Show resolved Hide resolved
rumqttc/src/lib.rs Outdated Show resolved Hide resolved
rumqttc/src/lib.rs Outdated Show resolved Hide resolved
@swanandx swanandx merged commit 6d7bd82 into bytebeamio:main Jun 18, 2024
4 checks passed
@xiaocq2001
Copy link
Contributor Author

xiaocq2001 commented Jun 18, 2024

Thanks.
WSS updates are here, please review.
#881

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.

Add customization options when using native-tls
4 participants