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

Restore support for native-tls #389

Closed
wants to merge 10 commits into from
Closed

Restore support for native-tls #389

wants to merge 10 commits into from

Conversation

jsha
Copy link
Collaborator

@jsha jsha commented May 22, 2021

This allows any of: rustls, native-tls, both, or neither. It replaces the stream::Inner enum with a trait, which will hopefully be more pleasant to work with.

Fixes #319

@jsha jsha requested a review from algesten May 22, 2021 03:01
@jsha jsha force-pushed the multi-tls branch 2 times, most recently from 5641107 to 7474035 Compare May 22, 2021 17:04
Copy link
Owner

@algesten algesten left a comment

Choose a reason for hiding this comment

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

This looks great to me. The Inner solution was what I was stuck on in my attempt.

👍

Thanks for doing this!

fn as_write_vec(&self) -> &[u8] {
panic!("as_write_vec on non Test stream");
}
}
Copy link
Owner

Choose a reason for hiding this comment

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

Nice!

@dralley
Copy link

dralley commented Jul 4, 2021

Is anything blocking this from merging? @jsha @algesten

@jsha
Copy link
Collaborator Author

jsha commented Jul 10, 2021 via email

Copy link

@dontlaugh dontlaugh left a comment

Choose a reason for hiding this comment

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

I do see how the feature gating in connect_https is a bit noisy, especially if you were to add another implementation. I have also read through #391 and it seems like a nice solution.

But I still lean towards this approach that doesn't introduce more types (yet).

There is nothing in this PR that precludes us from adding something like #391 later, right?

src/stream.rs Outdated Show resolved Hide resolved
Co-authored-by: Coleman McFarland <[email protected]>
@algesten
Copy link
Owner

Thanks @dontlaugh, that is good to hear.

Jacob is driving these changes, and he's currently on vacation, however before he left, the last thing we discussed was that he's leaning towards this solution too.

You weighing in gives us more confidence it is the right way forward. Thanks!

@jsha
Copy link
Collaborator Author

jsha commented Sep 28, 2021 via email

@algesten
Copy link
Owner

I will write more tomorrow, but I think there's a problem with intention here.

Why would one dep select native-tls instead of relying on defaults?

The only reason I believe would be that it consumes an API on TLS 1.0 or some bad cipher. Ie the function of the lib requires that backwards compat.

Making a global singleton wouldn't solve that, since we effectively could get libraries "fighting" over setting the singleton.

Maybe it would be better if ureq preferred native-tls if it is enabled, but there's an override switch on the agent builder?

@dontlaugh
Copy link

It's not just old ciphers. WebPKI, a hard dep of rustls, doesn't support IP SANs. briansmith/webpki#54

Honestly avoiding anything ring/ruslts/webpki makes everyone's life easier.

@algesten
Copy link
Owner

algesten commented Oct 2, 2021

Honestly avoiding anything ring/ruslts/webpki makes everyone's life easier.

I don't agree, but that's beside the point. I understand there are cases where people can't use rustls, and do want to support that. My comment is more about how we achieve that if we get diamond dependencies on ureq with different sets of feature flags.

@jsha
Copy link
Collaborator Author

jsha commented Oct 10, 2021

Closing in favor of #391

@jsha jsha closed this Oct 10, 2021
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.

Restore support for native-tls
4 participants