mirror of
https://git.asonix.dog/asonix/pict-rs
synced 2024-12-22 03:11:24 +00:00
Add public mechanism for installing aws-lc-rs
This commit is contained in:
parent
39da69b1aa
commit
33e72266f5
2 changed files with 15 additions and 0 deletions
13
src/lib.rs
13
src/lib.rs
|
@ -1937,6 +1937,19 @@ impl PictRsConfiguration {
|
|||
Ok(self)
|
||||
}
|
||||
|
||||
/// Install aws-lc-rs as the default crypto provider
|
||||
///
|
||||
/// This would happen automatically anyway unless rustls crate features get mixed up
|
||||
pub fn install_crypto_provider(self) -> Self {
|
||||
if rustls023::crypto::aws_lc_rs::default_provider()
|
||||
.install_default()
|
||||
.is_err()
|
||||
{
|
||||
tracing::info!("rustls crypto provider already installed");
|
||||
}
|
||||
self
|
||||
}
|
||||
|
||||
/// Run the pict-rs application on a tokio `LocalSet`
|
||||
///
|
||||
/// This must be called from within `tokio::main` directly
|
||||
|
|
|
@ -4,6 +4,7 @@ fn main() -> color_eyre::Result<()> {
|
|||
pict_rs::PictRsConfiguration::build_default()?
|
||||
.install_tracing()?
|
||||
.install_metrics()?
|
||||
.install_crypto_provider()
|
||||
.run()
|
||||
.await
|
||||
})
|
||||
|
@ -18,6 +19,7 @@ fn main() -> color_eyre::Result<()> {
|
|||
pict_rs::PictRsConfiguration::build_default()?
|
||||
.install_tracing()?
|
||||
.install_metrics()?
|
||||
.install_crypto_provider()
|
||||
.run_on_localset()
|
||||
.await
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue