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

Remove sqlx features due to a bug in rustls/webpki failing to resolve IP addresses #2391

Closed
aadityadhruv opened this issue Nov 10, 2022 · 9 comments
Labels
deficiency Something doesn't work as well as it could upstream An unresolvable issue: an upstream dependency bug

Comments

@aadityadhruv
Copy link

Description

Currently sqlx in db_pools uses runtime-tokio-rustls as its feature. This has a bug which results in a InvalidDNSNameError for raw IP addresses as a part of the url. This is being fixed, however, it would be nice to let the user choose their TLS back-end.

To Reproduce

Setting the database url to a raw IP address as follows:

mysql://foo:bar@<IP>:3306/baz

Expected Behavior

The IP shouldn't need any DNS resolution.

Environment:

  • OS Distribution and Kernel: [Fedora 36, Kernel 6.0.5]
  • Rocket Version: [0.5.0-rc.2]

Additional Context

A simple fix is to remove the feature from sqlx, and let the user choose the backend.

@aadityadhruv aadityadhruv added the triage A bug report being investigated label Nov 10, 2022
@aadityadhruv
Copy link
Author

Here is a simple fix to resolve this issue #2392

@tn-dev-fl
Copy link

i got this error error occurred while attempting to establish a TLS connection: InvalidDNSNameError . it worked fine on my main machine . i tried to remove the features sqlx runtime i get another error
compile_error!( "one of the features ['runtime-actix-native-tls', 'runtime-async-std-native-tls',
'runtime-tokio-native-tls', 'runtime-actix-rustls', 'runtime-async-std-rustls',
'runtime-tokio-rustls'] must be enabled"
);
^

@aadityadhruv
Copy link
Author

You need to specify a runtime, you can use the tokio-native-tls one since rustls cannot resolve direct IP addresses yet.

@SergioBenitez SergioBenitez added deficiency Something doesn't work as well as it could and removed triage A bug report being investigated labels Mar 28, 2023
@SergioBenitez
Copy link
Member

I'm considering this an upstream isusue: #2392 (comment).

@SergioBenitez SergioBenitez added the upstream An unresolvable issue: an upstream dependency bug label Mar 28, 2023
@aadityadhruv
Copy link
Author

Yeah, I read that comment, I think that may be a suitable idea.

@SergioBenitez
Copy link
Member

Looks like the new rustls release fixes this! Shall we update dependencies and see if that's so?

@SergioBenitez
Copy link
Member

I updated rustls in Rocket in fbb0ace. I also sent a PR to sqlx to update rustls there as well (launchbadge/sqlx#2440). Since there's no issue on Rocket's end, and everything we could do from our side is now complete, I'm closing this out.

@aadityadhruv
Copy link
Author

That's great! So once sqlx updates rustls on their end, everything should be good to go right?

@SergioBenitez
Copy link
Member

Yup! It should just work if you cargo update, even without a new Rocket release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deficiency Something doesn't work as well as it could upstream An unresolvable issue: an upstream dependency bug
Projects
None yet
Development

No branches or pull requests

3 participants