forked from cadey/maj
serve cetacean.club
This commit is contained in:
parent
4b7374b39f
commit
ad7947c5fa
|
@ -8,7 +8,7 @@ use maj::{
|
||||||
};
|
};
|
||||||
use percent_encoding::percent_decode_str;
|
use percent_encoding::percent_decode_str;
|
||||||
use rustls::{
|
use rustls::{
|
||||||
internal::pemfile::{certs, rsa_private_keys},
|
internal::pemfile::{certs, pkcs8_private_keys, rsa_private_keys},
|
||||||
AllowAnyAnonymousOrAuthenticatedClient, Certificate, PrivateKey, RootCertStore, ServerConfig,
|
AllowAnyAnonymousOrAuthenticatedClient, Certificate, PrivateKey, RootCertStore, ServerConfig,
|
||||||
};
|
};
|
||||||
use std::{
|
use std::{
|
||||||
|
@ -57,15 +57,15 @@ fn load_certs(path: &Path) -> io::Result<Vec<Certificate>> {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn load_keys(path: &Path) -> io::Result<Vec<PrivateKey>> {
|
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"))
|
.map_err(|_| io::Error::new(io::ErrorKind::InvalidInput, "invalid key"))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() -> Result<(), maj::server::Error> {
|
fn main() -> Result<(), maj::server::Error> {
|
||||||
env_logger::init();
|
env_logger::init();
|
||||||
let opts = Options::from_args();
|
let opts = Options::from_args();
|
||||||
let certs = load_certs(&opts.cert)?;
|
let certs = load_certs(&opts.cert).unwrap();
|
||||||
let mut keys = load_keys(&opts.key)?;
|
let mut keys = load_keys(&opts.key).unwrap();
|
||||||
|
|
||||||
log::info!(
|
log::info!(
|
||||||
"serving gemini://{} on {}:{}",
|
"serving gemini://{} on {}:{}",
|
||||||
|
|
Loading…
Reference in New Issue