client/server: crypto_provider accessor for configs

When holding a `ClientConfig` or a `ServerConfig` it may be helpful to
be able to access the `&Arc<CryptoProviver>` that will be used for the
configuration. This commit adds accessor functions for this purpose.
This commit is contained in:
Daniel McCarney 2024-02-20 10:00:55 -05:00
parent 50a656330b
commit 4aafdc838b
2 changed files with 10 additions and 0 deletions

View File

@ -325,6 +325,11 @@ impl ClientConfig {
}
}
/// Return the crypto provider used to construct this client configuration.
pub fn crypto_provider(&self) -> &Arc<CryptoProvider> {
&self.provider
}
/// Access configuration options whose use is dangerous and requires
/// extra care.
pub fn dangerous(&mut self) -> danger::DangerousClientConfig<'_> {

View File

@ -469,6 +469,11 @@ impl ServerConfig {
}
}
/// Return the crypto provider used to construct this client configuration.
pub fn crypto_provider(&self) -> &Arc<CryptoProvider> {
&self.provider
}
/// We support a given TLS version if it's quoted in the configured
/// versions *and* at least one ciphersuite for this version is
/// also configured.