Description
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:
- Updating how the server/client presents themselves.
- 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.
These 2 functions in the config are not relevant to us.
Additional context
- Enable TLS Configuration with in-memory PEM strings #2
- Support custom certificate verification cloudflare/quiche#326 (comment)
Tasks
- Add in
setTLSConfig
toQUICServer
. - Test rotation of certificates
- Explore if we want to also be able to rotate the trusted certificate authorities too.