serve cetacean.club

This commit is contained in:
Cadey Ratio 2020-08-01 21:55:08 +00:00
parent 4b7374b39f
commit ad7947c5fa
1 changed files with 4 additions and 4 deletions

View File

@ -8,7 +8,7 @@ use maj::{
};
use percent_encoding::percent_decode_str;
use rustls::{
internal::pemfile::{certs, rsa_private_keys},
internal::pemfile::{certs, pkcs8_private_keys, rsa_private_keys},
AllowAnyAnonymousOrAuthenticatedClient, Certificate, PrivateKey, RootCertStore, ServerConfig,
};
use std::{
@ -57,15 +57,15 @@ fn load_certs(path: &Path) -> io::Result<Vec<Certificate>> {
}
fn load_keys(path: &Path) -> io::Result<Vec<PrivateKey>> {
rsa_private_keys(&mut BufReader::new(File::open(path)?))
pkcs8_private_keys(&mut BufReader::new(File::open(path)?))
.map_err(|_| io::Error::new(io::ErrorKind::InvalidInput, "invalid key"))
}
fn main() -> Result<(), maj::server::Error> {
env_logger::init();
let opts = Options::from_args();
let certs = load_certs(&opts.cert)?;
let mut keys = load_keys(&opts.key)?;
let certs = load_certs(&opts.cert).unwrap();
let mut keys = load_keys(&opts.key).unwrap();
log::info!(
"serving gemini://{} on {}:{}",