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

Support to rustls 0.20 #1388

Merged
merged 1 commit into from Nov 29, 2021

Conversation

BiagioFesta
Copy link
Contributor

@BiagioFesta BiagioFesta commented Nov 26, 2021

Yet another attempt to support rustls 0.20

Fix: #1363

Thanks to @satyarohith for the cross check with the related work.

Some changes (due to interface change in rustls):

  • Parse of pem certificate and keys are now outside rustls. Used rustls-pemfile.
  • Removed dependency webpki::DNSNameRef. Now it uses "native" rustls::ServerName.
  • Updated related dependencies.
  • Changed all logic in the tls configuration creation. Now rustls uses a builder with a "pattern-state" approach.

Cargo.toml Outdated
@@ -81,6 +81,7 @@ url = "2.2"
bytes = "1.0"
serde = "1.0"
serde_urlencoded = "0.7"
proc-macro-hack = "0.5.19"
Copy link
Contributor

Choose a reason for hiding this comment

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

What's this doing here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Merely because of this.

In my branch there is a dependency with proc-macro-hack=0.5.19.

Using the minimum version (i.e., proc-macro-hack = 0.5.0), the latter crate fails to compile (i.e., cargo check).

It is still unclear to me why my change brings that dependency.
Maybe there is a not trivial dependency with some proc-macros.

Open to suggestions here :D

Copy link
Contributor

Choose a reason for hiding this comment

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

It is still unclear to me why my change brings that dependency

Ah I see, it's probably the other way around though. Somebody who was already requiring an higher version of proc-macro-hack removed the dependency on it (probably rust-lang/futures-rs#2520), causing 0.5.0 to be eligible once again.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure of a good solution to this other than upgrading to cookie 0.16, which because of it using time 0.3 doesn't depend on proc-macro-hack at all.
If we have to stick with this workaround though I think it would be better to at least make proc-macro-hack an optional dependency and import it only with the cookie feature.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Honestly, I don't see any better too.
Moved in the cookie optional dep.

@seanmonstar seanmonstar merged commit 8b37ae4 into seanmonstar:master Nov 29, 2021
@seanmonstar
Copy link
Owner

Thanks so much!

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.

Port reqwest to rustls 0.20
3 participants