mirror of https://github.com/ctz/rustls
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:
parent
50a656330b
commit
4aafdc838b
|
@ -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<'_> {
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue