mirror of
https://github.com/atuinsh/atuin.git
synced 2024-11-24 09:15:09 +01:00
fix as much as we can
Currently awaiting other crates we depend on to update. sqlx, axum-server, etc, all use 0.21
This commit is contained in:
parent
2a508562cd
commit
07f53a74b6
1
Cargo.lock
generated
1
Cargo.lock
generated
@ -403,6 +403,7 @@ dependencies = [
|
||||
"reqwest",
|
||||
"rustls 0.23.9",
|
||||
"rustls-pemfile 2.1.2",
|
||||
"rustls-pki-types",
|
||||
"semver",
|
||||
"serde",
|
||||
"serde_json",
|
||||
|
@ -37,3 +37,4 @@ argon2 = "0.5"
|
||||
semver = { workspace = true }
|
||||
metrics-exporter-prometheus = "0.12.1"
|
||||
metrics = "0.21.1"
|
||||
rustls-pki-types = "1.7.0"
|
||||
|
@ -14,7 +14,6 @@ mod metrics;
|
||||
mod router;
|
||||
mod utils;
|
||||
|
||||
use rustls::ServerConfig;
|
||||
pub use settings::example_config;
|
||||
pub use settings::Settings;
|
||||
|
||||
@ -86,8 +85,7 @@ async fn launch_with_tls<Db: Database>(
|
||||
let certificates = settings.tls.certificates()?;
|
||||
let pkey = settings.tls.private_key()?;
|
||||
|
||||
let server_config = ServerConfig::builder()
|
||||
.with_safe_defaults()
|
||||
let server_config = rustls::server::ServerConfig::builder()
|
||||
.with_no_client_auth()
|
||||
.with_single_cert(certificates, pkey)?;
|
||||
|
||||
|
@ -112,12 +112,12 @@ pub struct Tls {
|
||||
}
|
||||
|
||||
impl Tls {
|
||||
pub fn certificates(&self) -> Result<Vec<rustls::Certificate>> {
|
||||
pub fn certificates(&self) -> Result<Vec<rustls_pki_types::CertificateDer>> {
|
||||
let cert_file = std::fs::File::open(&self.cert_path)
|
||||
.with_context(|| format!("tls.cert_path {:?} is missing", self.cert_path))?;
|
||||
let mut reader = std::io::BufReader::new(cert_file);
|
||||
|
||||
let certs: Vec<_> = rustls_pemfile::certs(&mut reader)
|
||||
.map(|c| c.map(|c| rustls::Certificate(c.to_vec())))
|
||||
.collect::<Result<Vec<_>, _>>()
|
||||
.with_context(|| format!("tls.cert_path {:?} is invalid", self.cert_path))?;
|
||||
|
||||
@ -131,12 +131,12 @@ impl Tls {
|
||||
Ok(certs)
|
||||
}
|
||||
|
||||
pub fn private_key(&self) -> Result<rustls::PrivateKey> {
|
||||
pub fn private_key(&self) -> Result<rustls_pki_types::PrivateKeyDer> {
|
||||
let pkey_file = std::fs::File::open(&self.pkey_path)
|
||||
.with_context(|| format!("tls.pkey_path {:?} is missing", self.pkey_path))?;
|
||||
let mut reader = std::io::BufReader::new(pkey_file);
|
||||
let keys = rustls_pemfile::pkcs8_private_keys(&mut reader)
|
||||
.map(|c| c.map(|c| rustls::PrivateKey(c.secret_pkcs8_der().to_vec())))
|
||||
.map(|c| c.map(|c| rustls_pki_types::PrivateKeyDer::Pkcs8(c)))
|
||||
.collect::<Result<Vec<_>, _>>()
|
||||
.with_context(|| format!("tls.pkey_path {:?} is not PKCS8-encoded", self.pkey_path))?;
|
||||
|
||||
@ -147,6 +147,6 @@ impl Tls {
|
||||
);
|
||||
}
|
||||
|
||||
Ok(keys[0].clone())
|
||||
Ok(keys[0])
|
||||
}
|
||||
}
|
||||
|
@ -21,6 +21,7 @@ function Login(props: LoginProps) {
|
||||
const key = form.key.value;
|
||||
|
||||
console.log("Logging in...");
|
||||
|
||||
try {
|
||||
await login(username, password, key);
|
||||
refreshUser();
|
||||
|
Loading…
Reference in New Issue
Block a user