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

Improve ease-of-use for untrusted communications #58

Closed
1 of 2 tasks
Ralith opened this issue Oct 13, 2018 · 9 comments
Closed
1 of 2 tasks

Improve ease-of-use for untrusted communications #58

Ralith opened this issue Oct 13, 2018 · 9 comments
Labels
enhancement New feature or request

Comments

@Ralith
Copy link
Collaborator

Ralith commented Oct 13, 2018

Currently, it is only possible to connect to a server whose certificate is signed by a trusted authority. While this is ideal for web services, for some applications there is no expectation of or even feasible mechanism for this level of trust. Examples include tests, P2P applications with transient peers, and systems where trust is managed externally. Quinn should support these gracefully, without undermining security for applications where useful certificate authorities exist.

To accomplish this, we need:

  • Support for selectively disabling trust checks on outgoing connections (Client configuration API #57)
  • Helpers to generate a self-signed (or unsigned?) certificate for a server
    This API should make it convenient, but optional, to cache generated certificates in persistent storage, for convenience in systems which can take advantage of a persistent identity, such as in pseudonymous or trust-on-first-use models. Blocked by rustls missing support for generating certificates.
@Ralith Ralith added the enhancement New feature or request label Oct 13, 2018
@est31
Copy link
Contributor

est31 commented Nov 24, 2018

I'm planning on a crate that allows generation of self signed certificates for this very purpose.

@est31
Copy link
Contributor

est31 commented Jan 4, 2019

There it is: https://github.com/est31/rcgen

I want to split it up into two crates: a library and a tool.

@djc
Copy link
Member

djc commented Jan 4, 2019

Do you have API docs up somewhere?

@briansmith
Copy link

IMO a library like this should almost definitely not be providing an API for generating self-signed certificates or making it easy to trust arbitrary certificates. Instead, I think the library should provide an extension point that allows a completely separate crate to plug in such unsafe things. This is what Rustls does, in particular.

In the case of testing code, it is usually much better to have tests use certificates that have "real-looking" certificate chains: end-entity <- intermediate <- root, where the root is a custom one. That way the majority of the tests reflect the real-world ideal use of the library.

@est31
Copy link
Contributor

est31 commented Jan 4, 2019

@djc eventually it'll be uploaded to docs.rs (the current crates.io presence is mostly a placeholder), but for that I need an upstream crate to merge my changes and publish a new version. Until then I recommend either cloning and doing cargo doc manually, or including it only in Cargo.toml, and cargo doc manually. Also, you can look at the main.rs.

@djc
Copy link
Member

djc commented Jan 4, 2019

@briansmith while I agree with you in the case of webpki, note that QUIC is also attractive for any number of different scenarios, including peer-to-peer networks where no CA is available. For these scenarios (and hidden behind an off-by-default feature flag) it seems to me that generating certificates on the fly would still make sense.

@est31
Copy link
Contributor

est31 commented Jan 4, 2019

I want to use QUIC for games and I don't want to require people to manually create/renew certificates or domain names when they want to set up servers or a LAN game or something. It should "just work". Autogenerating some 100 year valid dummy cert on the server at each restart and making the clients accept any cert the server presents is a good initial approach for this. Whether this is done in quinn directly or whether users of quinn have to integrate rkgen themselves, I don't really care.

@briansmith how would you envision an API to be that requires you to use a third party crate if you want to turn off certificate checks?

@Ralith
Copy link
Collaborator Author

Ralith commented Jan 4, 2019

I'm not necessarily averse to disposable certificate generation being external, if it is otherwise very convenient. My concern is that any barriers here will lead people to stick with the "easier" totally unencrypted UDP/TCP solutions they're accustomed to for non-web applications, which does not seem like an improvement.

@est31
Copy link
Contributor

est31 commented Jan 6, 2019

Okay, I've published version 0.1.0 of rcgen on crates.io.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants