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

How to get credentials outside of a demo example #130

Open
cBournhonesque opened this issue Jan 25, 2024 · 4 comments
Open

How to get credentials outside of a demo example #130

cBournhonesque opened this issue Jan 25, 2024 · 4 comments
Assignees
Labels
question Further information is requested

Comments

@cBournhonesque
Copy link

Hi,

I got a test working where I'm generating self-signed certificates; which I need to include in the client with the server_certificate_hashes option.

But in a real use-case where I deploy my server, how would clients get correct credentials?

@BiagioFesta
Copy link
Owner

BiagioFesta commented Jan 25, 2024

Generally, for PROD environments the server should present a valid (trusted by known CA) certificate and serverCertificateHashes is not required (as client can validate the proper certificate). So PROD environment should rely on PKI mechanisms.

I intend serverCertificateHashes more for Development/Testing environment, also because there are a few constraints on its usage: see requirements here. For instance, the certificate validity period cannot be more than 2 weeks.


Having said that, I don't know if you already had a look at wtransport/examples/full.rs.

In that example, the server is also serving the web resources (the client web application), and when the server starts the certificates is injected in the javascript.

With this approach, the web client is "dynamic" and can always be potentially updated by the server itself with its hash.

@BiagioFesta BiagioFesta self-assigned this Jan 25, 2024
@BiagioFesta BiagioFesta added the question Further information is requested label Jan 25, 2024
@cBournhonesque
Copy link
Author

Thanks!

  • I will check out PKI mechanisms. ("PKI webtransport" doesn't give much info on google unfortunately)
  • the example is pretty cool! In my case I'm not sure if the server can also serve the web client, but I like the idea :)

@BiagioFesta
Copy link
Owner

BiagioFesta commented Jan 25, 2024

Sorry, PKI stands for Public Key Infrastructure, it is how generally certificate infrastructure works.

What I meant is: if you have a PROD environment you should rely on good practices like serving a certificate that clients can check against a well-known trusted authority (CA).

There are free solution to sign a certificate, for example: https://letsencrypt.org/

@MOZGIII
Copy link
Contributor

MOZGIII commented Apr 10, 2024

@cBournhonesque consider using xwt-cert-utils if you need this in wasm. wtransport doesn't build in wasm.

@BiagioFesta serverCertificateHashes is absolutely intended for production environments, as they can provide even better transport security by requiring that the server an exact certificate that matches the requested hash. This gives the application a chance to defend against MITM attacks that compromise the Web PKI root certs storage of the client. Those have been quite prominent in the wild lately, and before the serverCertificateHashes capabilities you'd need a native app to defend against those. So, the serverCertificateHashes is very useful as an intended way of running production.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants