mirror of
https://git.asonix.dog/asonix/pict-rs.git
synced 2024-11-30 21:41:03 +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)
|
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`
|
/// Run the pict-rs application on a tokio `LocalSet`
|
||||||
///
|
///
|
||||||
/// This must be called from within `tokio::main` directly
|
/// This must be called from within `tokio::main` directly
|
||||||
|
|
|
@ -4,6 +4,7 @@ fn main() -> color_eyre::Result<()> {
|
||||||
pict_rs::PictRsConfiguration::build_default()?
|
pict_rs::PictRsConfiguration::build_default()?
|
||||||
.install_tracing()?
|
.install_tracing()?
|
||||||
.install_metrics()?
|
.install_metrics()?
|
||||||
|
.install_crypto_provider()
|
||||||
.run()
|
.run()
|
||||||
.await
|
.await
|
||||||
})
|
})
|
||||||
|
@ -18,6 +19,7 @@ fn main() -> color_eyre::Result<()> {
|
||||||
pict_rs::PictRsConfiguration::build_default()?
|
pict_rs::PictRsConfiguration::build_default()?
|
||||||
.install_tracing()?
|
.install_tracing()?
|
||||||
.install_metrics()?
|
.install_metrics()?
|
||||||
|
.install_crypto_provider()
|
||||||
.run_on_localset()
|
.run_on_localset()
|
||||||
.await
|
.await
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue