Update readme
This commit is contained in:
parent
06282ee085
commit
f799eb49e1
|
@ -48,7 +48,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||
.with_cert_resolver(rx);
|
||||
|
||||
HttpServer::new(|| App::new().route("/", web::get().to(index)))
|
||||
.bind_rustls_021("0.0.0.0:8443", server_config)?
|
||||
.bind_rustls_0_22("0.0.0.0:8443", server_config)?
|
||||
.bind("0.0.0.0:8080")?
|
||||
.run()
|
||||
.await?;
|
||||
|
@ -61,7 +61,6 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||
async fn read_key() -> Result<Option<rustls::sign::CertifiedKey>, Box<dyn std::error::Error>> {
|
||||
let cert_bytes = tokio::fs::read("./out/example.crt").await?;
|
||||
let certs = rustls_pemfile::certs(&mut cert_bytes.as_slice())
|
||||
.map(|res| res.map(|c| rustls::Certificate(c.to_vec())))
|
||||
.collect::<Result<Vec<_>, _>>()?;
|
||||
|
||||
let key_bytes = tokio::fs::read("./out/example.key").await?;
|
||||
|
@ -70,7 +69,7 @@ async fn read_key() -> Result<Option<rustls::sign::CertifiedKey>, Box<dyn std::e
|
|||
};
|
||||
|
||||
let private_key =
|
||||
rustls::sign::any_supported_type(&rustls::PrivateKey(Vec::from(private_key.secret_der())))?;
|
||||
rustls::crypto::ring::sign::any_supported_type(&private_key)?;
|
||||
|
||||
Ok(Some(rustls::sign::CertifiedKey::new(certs, private_key)))
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue