A recent commit introduced a ConfigLoader. ConfigLoader is used in lieu of a static certificate when creating a TLS server, so the QUIC server can reload TLS certificates when needed.
Using the ConfigLoader looks something like this:
struct QuicTlsLoader {
tls: Arc<TlsMaterials>,
}
impl s2n_quic::provider::tls::s2n_tls::ConfigLoader for QuicTlsLoader {
fn load(
&mut self,
cx: s2n_quic::provider::tls::s2n_tls::ConnectionContext,
) -> s2n_tls::config::Config {
// build a s2n_tls config with current certificate
return myConfig
}
}
let loader = QuicTlsLoader{ tls };
let tls_provider =
s2n_quic::provider::tls::default::Server::from_loader(loader);
let server = s2n_quic::Server::builder()
.with_tls(tls_provider)?
.start();
At which point the compiler complains:
the trait bound s2n_quic::provider::tls::default::Server<QuicTlsLoader>: s2n_quic::provider::tls::Provider is not satisfied
the trait s2n_quic::provider::tls::Provider is implemented for s2n_quic::provider::tls::default::Server
required for s2n_quic::server::Builder<impl ServerProviders> to implement s2n_quic::provider::tls::With<s2n_quic::provider::tls::default::Server<QuicTlsLoader>>rustcE0277
required by a bound in s2n_quic::server::Builder::<Providers>::with_tls
Problem:
A recent commit introduced a ConfigLoader. ConfigLoader is used in lieu of a static certificate when creating a TLS server, so the QUIC server can reload TLS certificates when needed.
Using the ConfigLoader looks something like this:
At which point the compiler complains:
Solution:
Modify the s2n_quic::provider::tls::Provider to implement Provider for generic
Server<T>
.Requirements / Acceptance Criteria:
The developer can now use
ConfigLoader
without having to implement Provider for the resultingServer<T>
themselves.