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

test fails without feature tls12 #107

Open
jonassmedegaard opened this issue Jun 27, 2022 · 6 comments
Open

test fails without feature tls12 #107

jonassmedegaard opened this issue Jun 27, 2022 · 6 comments

Comments

@jonassmedegaard
Copy link

One test requires feature tls12, or it fails like this:

error[E0425]: cannot find value `TLS12` in module `rustls::version`
  --> tests/badssl.rs:46:53
   |
46 |         .with_protocol_versions(&[&rustls::version::TLS12])
   |                                                     ^^^^^ help: a static with a similar name exists: `TLS13`
   |
  ::: /tmp/tmp.oYhCcK9rbh/registry/rustls-0.20.6/src/versions.rs:31:1
   |
31 | pub static TLS13: SupportedProtocolVersion = SupportedProtocolVersion {
   | --------------------------------------------------------------------- similarly named static `TLS13` defined he
re
@LucioFranco
Copy link
Member

What test command are you running?

@jonassmedegaard
Copy link
Author

Sorry, I forgot to copy that and no longer have that build log lying around - but it was likely cargo test --all-targets --no-default-features.

I am packaging this crate for Debian, and run tests in various feature combinations.

@jonassmedegaard
Copy link
Author

jonassmedegaard commented Jun 27, 2022

This one-line fix solved the issue for me: https://salsa.debian.org/debian/rust-tokio-rustls/-/blob/debian/latest/debian/patches/1001_tls12.patch

--- a/tokio-rustls/tests/badssl.rs
+++ b/tokio-rustls/tests/badssl.rs
@@ -32,6 +32,7 @@
 }
 
 #[tokio::test]
+#[cfg(feature = "tls12")]
 async fn test_tls12() -> io::Result<()> {
     let mut root_store = rustls::RootCertStore::empty();
     root_store.add_server_trust_anchors(webpki_roots::TLS_SERVER_ROOTS.0.iter().map(|ta| {

@quininer
Copy link
Member

Good catch, would you like to open a PR?

@jonassmedegaard
Copy link
Author

Thanks for the kind suggestion, but no - for political reasons: Github Terms of Service arguably contains a special licensing clause which is not problematic for liberally licensed code like this project but effectively weakens stronger copyleft licensed code. I therefore never push code to Github.

I already shared the code change as a patch. Please tell me if helpful to you that I provide it as a git branch that you can clone and merge. I fully understand if you have no interest in playing along with my policital game, though.

@jonassmedegaard
Copy link
Author

Anyone else feel like fixing this?

I notice that a new release went out, without this getting fixed :-(

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

No branches or pull requests

3 participants