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

TLS Rotation for QUICServer and QUICClient #3

Closed
CMCDragonkai opened this issue Apr 11, 2023 · 3 comments
Closed

TLS Rotation for QUICServer and QUICClient #3

CMCDragonkai opened this issue Apr 11, 2023 · 3 comments
Assignees
Labels
development Standard development r&d:polykey:core activity 4 End to End Networking behind Consumer NAT Devices

Comments

@CMCDragonkai
Copy link
Member

Specification

TLS certs may be changed while the server is running, or while we are using the client. We need to be able to swap out the TLS certs without impacting old connections.

QUICServer

The QUICServer manages multiple QUICConnection connections. Each QUICConnection is created with a QUICConfig POJO.

This mean when we swap out the TLS, we don't change the existing QUICConnection. We only change how new QUICConnection will get created.

So our QUICServer needs to new methods such as:

QUICServer.setTLSConfig(keyPrivatePem: PrivateKeyPEM, certChainPem: CertificatePEMChain);

This function would "update" the config POJO object. New connections would be initiated with the new TLS configuration. Existing connections would continue to use the old QuicheConfig object and would not be affected by the updated config POJO.

Tests should test starting with 1 cert, and creating connections, and while they are running, create a new cert, rotate the cert, and then create new connections using the new cert, while the old connections are still valid.

QUICClient

The QUICClient is one to one to a single QUICConnection. This means, a client cannot have its TLS config rotated live. Instead it's simply a matter of creating new QUIC clients with the new TLS config.

During testing of the QUICServer.setTLSConfig, tests should start new QUIC clients with the new TLS configuration too.

Remember, when updating the TLS configuration... we are really doing 2 things:

  1. Updating how the server/client presents themselves.
  2. Updating what the server/client accepts as acceptable certificates.

In our PK P2P situation, we won't just use the OS default certificate store. We will actually want to verify that the other certs is one that we trust.

This means when PK is using it, it actually has to disable the peer verification and put in its own custom verification: cloudflare/quiche#326 (comment).

This technically means we don't really care about the certificate store.

image

These 2 functions in the config are not relevant to us.

Additional context

Tasks

  1. Add in setTLSConfig to QUICServer.
  2. Test rotation of certificates
  3. Explore if we want to also be able to rotate the trusted certificate authorities too.
@CMCDragonkai CMCDragonkai added the development Standard development label Apr 11, 2023
@tegefaulkes tegefaulkes self-assigned this Apr 17, 2023
tegefaulkes added a commit that referenced this issue Apr 17, 2023
@tegefaulkes
Copy link
Contributor

Tasks 1 and 2 are done. I'm skipping task 3 for now unless we really need it.

@CMCDragonkai
Copy link
Member Author

What's difference between rotating certs and rotating CA certs?

@tegefaulkes
Copy link
Contributor

This has been updated. We can now modify the whole QUICConfig using QUICServer.updateConfig(config: Partial<QUICConfig>)

We can use this to update the TLS certs and the CA cert. Setting the CA cert can't be set using a cert from memory for now. I still need to add that.

tegefaulkes added a commit that referenced this issue Apr 19, 2023
CMCDragonkai pushed a commit that referenced this issue May 17, 2023
CMCDragonkai pushed a commit that referenced this issue May 17, 2023
@CMCDragonkai CMCDragonkai added the r&d:polykey:core activity 4 End to End Networking behind Consumer NAT Devices label Jul 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
development Standard development r&d:polykey:core activity 4 End to End Networking behind Consumer NAT Devices
Development

No branches or pull requests

2 participants