Skip to content

Add features for other tls types #497

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

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

Conversation

tylerhawkes
Copy link

This is a continuation of #465 that was originally done by @ctrlaltf24.

My company has been using that branch with a few minor improvements. I just got the tests passing by changing how the certificates and keys are generated so that rustls will accept localhost in a secure connection.

ctrlaltf24 and others added 17 commits September 19, 2024 19:24
Turned out to be rather easy due to all tls being handled by our dependencies.

Don't love the _fallback-tls feature, however with it we can use cargo-all-features,
which helps reduce feature related bugs.

Downside of cargo-all-features is it takes a long time to execute.

Fixes: 1c3t3a#407, 1c3t3a#366
There's still an error with ci.
engineio/src/lib.rs/test/tls_connector doesn't function the same as native-tls one (as it properly validates hostnames)

Needs further investigation as to why the hostname shows as invalid in ci. If we no longer need that, then this PR can be merged.
Turned out to be rather easy due to all tls being handled by our dependencies.

Don't love the _fallback-tls feature, however with it we can use cargo-all-features,
which helps reduce feature related bugs.

Downside of cargo-all-features is it takes a long time to execute.

Fixes: 1c3t3a#407, 1c3t3a#366
There's still an error with ci.
engineio/src/lib.rs/test/tls_connector doesn't function the same as native-tls one (as it properly validates hostnames)

Needs further investigation as to why the hostname shows as invalid in ci. If we no longer need that, then this PR can be merged.
NXD-0: Update webpki due to vulnerabilities
…s-types' into tyler/feat-add-features-for-other-tls-types
.build()
.unwrap(),
)
// .tls_config(
Copy link
Author

Choose a reason for hiding this comment

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

I can remove this, since it isn't needed for the tests to pass.

@@ -42,9 +42,9 @@ impl AsyncWebsocketGeneralTransport {
let mut sender = self.sender.lock().await;

sender
.send(Message::text(Cow::Borrowed(from_utf8(&Bytes::from(
.send(Message::text(Utf8Bytes::try_from(Bytes::from(
Copy link
Author

Choose a reason for hiding this comment

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

This and the other changes in this file are due to upgrading tungstenite. This avoids an extra allocation that was happening inside of the text call.


pub(crate) fn tls_connector() -> error::Result<TlsConnector> {
pub fn tls_connector() -> error::Result<TlsConfig> {
Copy link
Author

Choose a reason for hiding this comment

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

this is exposed to the socketio crate for use in tests.

Comment on lines +212 to +215
#[cfg_attr(
feature = "_native-tls",
doc = r#"
# Example for native-tls
Copy link
Author

Choose a reason for hiding this comment

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

These look less appealing, but allows the docs build for all feature configurations

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.

4 participants