fix dx serve https=true error: 'no process-level CryptoProvider available -- call CryptoProvider::install_default() before this point' (#4736)
This commit is contained in:
1 parent
9359446017
commit
fc01a002fd
1 file changed
+5
-1
@@ -26,6 +26,7 @@ use futures_util::{
|
|||||||
StreamExt,
|
StreamExt,
|
||||||
};
|
};
|
||||||
use hyper::HeaderMap;
|
use hyper::HeaderMap;
|
||||||
|
use rustls::crypto::{aws_lc_rs::default_provider, CryptoProvider};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use std::{
|
use std::{
|
||||||
convert::Infallible,
|
convert::Infallible,
|
||||||
@@ -412,7 +413,10 @@ async fn devserver_mainloop(
|
|||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we're using rustls, we need to get the cert/key paths and then set up rustls
|
// If we're using rustls, we need to install the provider, get the cert/key paths, and then set up rustls
|
||||||
|
if let Err(provider) = CryptoProvider::install_default(default_provider()) {
|
||||||
|
bail!("Failed to install default CryptoProvider: {provider:?}");
|
||||||
|
}
|
||||||
let (cert_path, key_path) = get_rustls(&https_cfg).await?;
|
let (cert_path, key_path) = get_rustls(&https_cfg).await?;
|
||||||
let rustls = axum_server::tls_rustls::RustlsConfig::from_pem_file(cert_path, key_path).await?;
|
let rustls = axum_server::tls_rustls::RustlsConfig::from_pem_file(cert_path, key_path).await?;
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user